The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> PHP Development
|
PHP-General - Downloading/Uploading
Discuss Downloading/Uploading in the PHP Development forum on Dev Shed. Downloading/Uploading PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

December 15th, 2012, 04:13 AM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 3
Time spent in forums: 45 m 34 sec
Reputation Power: 0
|
|
|
PHP-General - Downloading/Uploading
How Can I Upload And Download Files From Mysql Database...
I want to store my files into MYSQl Database With Different Id's And Want To Show It to user If user click it then File Will Download from MYsql.
Thanks in advance
|

December 15th, 2012, 04:26 AM
|
 |
pollyanna
|
|
Join Date: Jul 2012
Location: Germany
|
|
|
Hi,
do you want to actually store the file content in the database? If so, why? Why not use the file system for that?
|

December 15th, 2012, 04:51 AM
|
 |
Contributing User
|
|
|
|
|
It's not wise to upload files into a database, not only will it bloat the database but will make it run slower if there are any queries to that database, its better to use a file system
|

December 15th, 2012, 04:54 AM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 3
Time spent in forums: 45 m 34 sec
Reputation Power: 0
|
|
|
I Don't Know How to Use File System.......I Am Beginner in php...
|

December 15th, 2012, 05:05 AM
|
 |
Contributing User
|
|
|
|
|
Read up regarding using $_FILES, it should be helpful
|

December 15th, 2012, 05:11 AM
|
 |
pollyanna
|
|
Join Date: Jul 2012
Location: Germany
|
|
If you don't know something, then the solution is to learn it. Just google for "php file upload", and you'll find plenty of explanations and examples (but skip w3schools, they usually tell you bullsh*t).
The PHP manual even has a whole chapter on this topic:
http://php.net/manual/en/features.file-upload.php
Be aware that letting users upload files is always dangerous, so read up on security, too. For example, you don't want people to upload PHP scripts and play with your server.
|

December 15th, 2012, 05:23 AM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 3
Time spent in forums: 45 m 34 sec
Reputation Power: 0
|
|
|
Jacques1
I go through uploading File Tutorial. But I want Download File Tutorial...
Because I want to make a web site for college in that i want to put a file upload function for Faculty And Download Function For Student.......
If a faculty logged in then he/she can upload notes.. and then if a student logged in then he/she can see what all are uploads from faculty and if he/she want's it then click it and get the file.......
|

December 17th, 2012, 12:41 AM
|
|
|
|
Look up scandir and opendir. These functions allow you to look through a directory and list the items inside. Just look at a few examples of that and you should be good.
The most difficult part would setting up the file system in a well organized way that way you list what you want to list to the right people.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|