Page 1 of 1

PHP Upload...with MySQL?

Posted: Sat Apr 17, 2004 3:40 pm
by bumple
Hi all,

I have a website for friends of mine to come, register, log in, and access a few members pages (all working very well). However, my latest project for the members section is to add a upload documents page for my friends to upload Word documents (.doc) to my website. Since there will be many members at my site, I was wondering...is there a possibility to store the .doc files in my MySQL database? Or should I save all the documents in a folder on my server with the username as the document name? Thanks a lot!

Posted: Sat Apr 17, 2004 4:31 pm
by kettle_drum
You can do either, although its probably easier to just upload the files and store them in a dir. I added a file upload class to the code snipet forum on this site which will do everything you want - so you can use that, or copy from it.

But either way you will still have to upload the .doc file as when adding it to a database you will need the file to read from, so the user either has to serve it to the server, or upload it to the server.

Posted: Sat Apr 17, 2004 4:57 pm
by vigge89
i think you should store them in a directory, but i have one tip:
do not use their usernames as filenames, use their ID or something, becuase usernames could contain characters not allowed in an filename, have strange caps, spaces, etc..