Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Upload image on my site and rename in the DB

New Here ,
May 20, 2009 May 20, 2009

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

TOPICS
Server side applications
562
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
May 20, 2009 May 20, 2009

Heya Tim,

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

Good luck!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 21, 2009 May 21, 2009
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines