Jump to content

Archived

This topic is now archived and is closed to further replies.

Brendan

image upload

Recommended Posts

Hey, im just curious as to what the best way to upload image files is from an upload form.

If i were to upload them directly to a mysql database it would use up the mysql database more than i would want. If i were to upload it to the server and have an entry in mysql which would point to each file, then i'm afraid the files and mysql entries could get mixed up or something to that extent, such as the file being created but having an error where a mysql entry isnt created.

Any suggestions?

Share this post


Link to post
Share on other sites
There is no reason why your files and file references should get mixed up, as always, make sure you validate and escape [i]all[/i] user input to prevent any errors within the query.

Share this post


Link to post
Share on other sites
x[) this is why i don't use MySQL, just enumerate file names (0.jpg, 1.jpg, etc), put security on ur uploader so only certain file types are allowed, then enumerate displays with a function (a little while(file_exists("$num.jpg")) { } loop) and bam, you've avoided your problem

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.