Skip to main content
Participant
May 20, 2009
Question

Upload image on my site and rename in the DB

  • May 20, 2009
  • 2 replies
  • 558 views

hi,

I have a form where the user can change or add his avatar, i'd like to know what's the best way to allow image's upload (with a max size) and rename this image, something like ('username'.jpeg). this new image would replace the previous one. only one image per user. and if this user haven't upload image, a 'default.jpeg' would apear on his profile...

Any good solution or help for this problem??

Cheers

Tim

This topic has been closed for replies.

2 replies

May 22, 2009

Are u using PHP? If you want to replace the old image with the new one, u can use the unlink() function. This will delete the old image in the directory and replace it with the new image that u have just upload.

DwFAQ
Participating Frequently
May 20, 2009

Heya Tim,

I assume you're using php for scripting if so check out this page.

Good luck!