ruddie Posted February 13, 2011 Share Posted February 13, 2011 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! Link to comment https://forums.phpfreaks.com/topic/227543-profile-image-issue/ Share on other sites More sharing options...
Jessica Posted February 13, 2011 Share Posted February 13, 2011 Do you rename the file? If so, make sure each file has a unique name. Don't reuse the names from old files. Link to comment https://forums.phpfreaks.com/topic/227543-profile-image-issue/#findComment-1173713 Share on other sites More sharing options...
ruddie Posted February 13, 2011 Author Share Posted February 13, 2011 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 https://forums.phpfreaks.com/topic/227543-profile-image-issue/#findComment-1173717 Share on other sites More sharing options...
Jessica Posted February 13, 2011 Share Posted February 13, 2011 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 https://forums.phpfreaks.com/topic/227543-profile-image-issue/#findComment-1173719 Share on other sites More sharing options...
ruddie Posted February 13, 2011 Author Share Posted February 13, 2011 Okay, well I guess that's got to do it, no that pretty, but it should work just fine. Thanks for your help! And yes, great idea using the id + a timestamp! Thanks for your help, I must say, that was the fastest reply I ever had here lol. Link to comment https://forums.phpfreaks.com/topic/227543-profile-image-issue/#findComment-1173720 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.