#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    3
    Rep Power
    0

    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
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    Hi,

    do you want to actually store the file content in the database? If so, why? Why not use the file system for that?
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Location
    On planet earth
    Posts
    101
    Rep Power
    10
    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
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    3
    Rep Power
    0
    I Don't Know How to Use File System.......I Am Beginner in php...
  8. #5
  9. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Location
    On planet earth
    Posts
    101
    Rep Power
    10
    Read up regarding using $_FILES, it should be helpful
  10. #6
  11. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    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.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    3
    Rep 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.......
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2008
    Posts
    129
    Rep Power
    11
    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.

IMN logo majestic logo threadwatch logo seochat tools logo