I am making a file uploader and i am going to have the option of the members using folders to organize their files, but should i have actual folders on the server, or just virtual directories like through my database
Printable View
I am making a file uploader and i am going to have the option of the members using folders to organize their files, but should i have actual folders on the server, or just virtual directories like through my database
Virtual folders, if you're storing your uploaded files on a hard disk. ;)
we already talked about this mendhak... lol. Thanks for bringing it up though, i need to set this as resolved.
I should throw my 2 cents into the mix.
The way it should be implemented is that all the files, and related information, should be stored into the database. This way it prevents 'hotlinking' the file(s) from other sites. You can't easily control if a file is stored at yoursite.com/files but if its stored in a DB, they you have the ability to monitor/filter/pause before the actual download takes place (ie you might want to display an ad before they can download the file).
Storing large files in a database is not a good idea s retrieving them is a lot slower than just opening a file on the server file system. My suggestion is storing the files in a directory outside the document root and assigning each one a unique ID and a virtual path in the database and saving the file with a name that corresponds with its unique ID.Quote:
Originally Posted by k1ll3rdr4g0n
That could work too...Quote:
Originally Posted by visualAd
Actually that is a good idea.:thumb:
that is exactly what i am doing.Quote:
Originally Posted by visualAd
My script uploaded file 'mendhak.txt' and generates a new random name and stores it in /uploads/ directory which has forbidden access. The user never sees the generated name so they can never see the actual file.
when they go to download the file, i read from file, but i read it as 'downloadfile.txt' and not as the random name.