Jump to content


image upload

  • Please log in to reply
2 replies to this topic

#1 Brendan

  • Members
  • PipPip
  • Member
  • 26 posts

Posted 18 July 2006 - 06:18 AM

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?

#2 Kris

  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 18 July 2006 - 06:45 AM

There is no reason why your files and file references should get mixed up, as always, make sure you validate and escape all user input to prevent any errors within the query.

#3 True`Logic

  • Members
  • PipPipPip
  • Advanced Member
  • 59 posts

Posted 18 July 2006 - 11:38 AM

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

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users