Jump to content

Profile Image Issue


ruddie

Recommended Posts

Hello, currently, I got myself a site where you have your own profile and your own 'profile image'. I allow people to upload their own image, and checking my folder, it indeed uploads it correctly.

 

Now the issue starts when you try to delete your image, again - when deleted the image is deleted in the folder.. However, when then uploading a NEW image, it simply displays the old one (While the new one is actually in the folder!?)

 

I figured that if you would close the website, and then load it again - it works correctly (figured this means the old image is still loaded in your temp files or something?) Now I was wondering if you could actually somehow *force* the user to re-download this image when you upload a new one.

 

Thanks for your time! :D

Link to comment
Share on other sites

Ah yes.. I hoped that wasn't needed...

Right now I simply named the file the same is the user his username, and changed it every time.

However, I figured I can do it differently like giving it a sort of 'random' value, and store this value in my database, where I can then retrieve it from (Although that seems like an awful lot more work) - but if this is the only (or best) way, I'll do it like this.

Link to comment
Share on other sites

Ah yes.. I hoped that wasn't needed...

Right now I simply named the file the same is the user his username, and changed it every time.

However, I figured I can do it differently like giving it a sort of 'random' value, and store this value in my database, where I can then retrieve it from (Although that seems like an awful lot more work) - but if this is the only (or best) way, I'll do it like this.

It's the way I'd do it.

a good random value is the user's username or user_id plus the timestamp.

Store the new file name in your user table.

 

I'm not good at dealing with cache issues, so this is how I do it. There may be another way.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.