PDA

View Full Version : upload scripts to a database


burningarms
1-30-04, 06:21 PM
Hi everyone,

I've seen several questions and answers as to how to write a PHP script for uploading into a folder, but how does one go about creating the ability to upload into one's database? I'd like to allow uploads of large files, such as MP3s or Quicktime videos. I noticed something about a 2 MB file limit default that could be changed in PHP.ini. So, is this possible? Only with small files? Can one upload anything they want? If so, how might I build the interface to upload/play these media files?

Thanks a bunch

HalfaBee
1-30-04, 06:58 PM
For large files you are better off keeping them in a folder and just have a link to them in the db.

Have a look at www.hotscripts.com , I am sure there would be a suitable script for you there.

burningarms
2-3-04, 12:54 AM
Thanks, I'll check that site out. How would the security be while doing it that way? Would having everything just sitting in a folder(s) be as safe as having every file in a database? Especially if many different people are uploading files they don't want to be downloaded by others?

HalfaBee
2-3-04, 02:23 AM
You can put the files in a protected dir and only access them via a php script.
You would want to chmod the dir to 600 to stop all access server side and put a .htaccess in the dir to stop http access.

burningarms
2-5-04, 01:24 AM
What would I put in the htaccess which I put in the protected directories? Also, what do you mean by chmod the directory to 600?. I'm (semi) familiar with playing with the htaccess file, but I don't know anything about chmod. Could you expand a bit, or tell me where I might find a good tutorial?
Thanks again.

HalfaBee
2-5-04, 01:28 AM
Have a look at http://help.powweb.com

It explains both very well.