December 15th, 2012, 05:13 AM
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, 05:26 AM
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, 05:51 AM
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, 05:54 AM
I Don't Know How to Use File System.......I Am Beginner in php...
December 15th, 2012, 06:05 AM
Read up regarding using $_FILES, it should be helpful
December 15th, 2012, 06:11 AM
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:
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, 06:23 AM
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, 01: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.