SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member MikeMorgan733's Avatar
    Join Date
    Mar 2012
    Location
    USA
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MySQL Database Question

    Could the database be used as a private file retrieval account?

    Tell me if this sounds possible.

    Server files are stored as Blob data type on a Mysql Database or (accessible with a link to the file from the server), in one individual table row.

    This is called the password protected portion of the site.

    Customers are sent an email with their new password and user-name for this account.
    They can then download their files and even manage future files that are placed here.

    Understand what I'm trying to do, is their an alternative?

    Thanks!

  2. #2
    SitePoint Zealot joazito's Avatar
    Join Date
    Mar 2005
    Posts
    121
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It can, but there are alternatives and I think you shouldn't use the database as a file store. That's what the filesystem is for.

    Here's how I would do it:

    * Put the files inside a directory that is outside of your webserver's document root.
    * Store the location of each files in a rows in the database.
    * Use a script to serve the file to an authenticated user. (something like 'if ($user_has_access) {file_get_contents($file_location); die();})

  3. #3
    SitePoint Member MikeMorgan733's Avatar
    Join Date
    Mar 2012
    Location
    USA
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thank you!

    Upload a File and write to MySQL

    I see, so the location of users uploads would be stored in a server folder, and the download-able content a similar
    folder, which is made accessible after I either automatically or manually generate an authentication username and password for the MySQL database for downloading from the servers folder.


    Since developing and writing code is beyond my current skills, I'll probably
    resort to using an application for this. Thanks for explaining it Joazito.


    http://www.webassist.com/dreamweaver...ital-file-pro/

    http://php.about.com/od/phpwithmysql...d_file_sql.htm


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •