![]() |
Cannot upload duplicate image with the same filename(NOT A BUG) 0018.JPG is a duplicate image. Please upload the image with a different name. Sometimes it will accept an image with the same filename, usually appending a 1 or a 2 to the end of the filename (e.g. 0018.jpg will become 00181.jpg, if I upload 0018.jpg a third time, it will become 00182.jpg). Other times it will display the error message shown above. Why is it that sometimes this works and sometimes it doesn't? I'm using GD2, though the same thing happened with ImageMagick. |
Are you using vb-enhanded mode? I'm having a problem that is similar to yours but a lot worse- I've been trying to solve this with Michael but after a couple of messages he hasn't replied for a long time.... :mad: phpprobid - here I come... Anyone using vbenhanced Classifieds? What happens when you for example edit a product that has an image - try to upload that same image again (so when you edit you keep that image that is in first slot and add that same imge to the second slot and then save? ) In another words.... (don't try this on production environment unless you are really brave) 1) Upload an ad with one picture. 2) Then... go to edit and modify that ad so that you'll insert on second picture slot that same picture that is being used on first slot (so basically what you are doing is that you are keeping that old picture that is in that first slot and inserting a second picture that is the same as the first/old one - yes, it doesn't make much sense but...) 3) Save |
Your not suppose to be able to upload an image with the same name. That is why there is the whole duplication check in classifieds Code: Content visible to verified customers only.Now I dont see where there is an issue with editproduct at all here. Here is how the ad upload process works 1. You upload an ad ( we check on initial upload for an ad posted by you with the same filename. This is to prevent someone posted there ad twice. Sanity check for those impatient posters much like a forum double post check 2. You can edit a product and ad other images. Now if you want to add the same picture again 2 more times go for it. Thats your choice. I dont see a problem here. |
Mikan, I'm using the default, latest install, not vb-enhanced mode. Omegatron, I did a search on my code, and it is exactly the same as what you posted. Like I said before, it appears to be a random problem. Sometimes it will rename the files appending a 1 or a 2 to the end of the filename and upload just fine, but some of the time it will respond with the error message above. |
Quote:
|
Well then I would invite you to send a url login for me to test |
Omegatron, sent you a PM with the url. |
Sig Your issue is as I posted you cant upload a duplicate image on install it will die for the reasons I stated and should die and is coded this way. It is the same philosophy as a duplicate post in a forum |
So, what you're saying is that as long as the users are different or a certain amount of time has elapsed, even if someone is posting something with the same name, that will work? Just not the same user posting the same thing over and over? That makes sense, if so. As I'm testing, I'm using the same couple of usernames, so I can see the point to eliminate duplicate postings. I actually noticed that posting comments did the same thing if I tried to post the same thing twice. So that I am clear on how this works, let's say that three different users attempt to post images that are named "for_sale.jpg", all three of these should post with PhotoPost renaming the second one "for_sale1.jpg" and the third one would be renamed "for_sale2.jpg"? Is this correct? And if the same user were to attempt this same scenario, they would receive the error message that I have posted above? |
Yes different users can post images with the same name and they should be renamed as you state. However you can not upload an image with the same name if you have already done so. You got it ;) |
Hmm.. any ideas why that check doesn't work at all in my case? So in other words if a user uploads same picture (haven't tested this but I suspect (drawing conclusions from filenames and datestamps) that it can happen also when a user renews his ad) it'll get renamed with "1" but then happens what you already know. This problem started to occur starting from v2.40 / v2.41 |
No the check works everytime as I have explained it. If the filename and userid is the same. Speaking with the other user he was using multiple accounts testing so in that respect it follows the normal image rename convention. If you try uploading the same image with the same user it will fail as it should. |
Quote:
Can you take a good look at in your own code and think what could cause the problem that I'm having. You already know what happens in my case and how to make that problem happen. What your code does when you follow those steps and how is it possible that it's doing what it's doing? Because that fact is.. it does what I have told you and it's your code that's doing it. |
Right you say but this is something we can not reproduce using the default latest code on several different installs. You have refused all attempts that we have asked several times for access to your install to assist and test so given this there is nothing more I can say on this issue. I have explained exactly how things work and that second and third images can be the same image only the first image is checked. Basically if you want support on this issue you will need to be running unmodified files and we will need ftp and admin access. If we can not reproduce any errors then obviously we need to look directly at whats so special about yours. |
Quote:
Quote:
|
Background: uploadproduct.php Code: Content visible to verified customers only.(1) $realname = $_FILES['theimage']['name'][$eximages]; So that's that true file name that is being stored on a server .. so for example 8781mypic.jpg -> that 8781 part is userid and the filename that user has uploaded is mypic.jpg Then comes this line and this "fixfilenames" function: (2) $irealname = fixfilenames($realname); which is: (3) Code: Content visible to verified customers only.(4) Code: Content visible to verified customers only.Now since (1) is getting that filename from the server that contains userid for example that 8781mypic.jpg and as far as I can see neither (2) nor (3) removes that userid part how is it possible that query ever works because it's looking for irealname which is in this case 8781mypic.jpg but in the database it's mypic.jpg Since that returns "0" that imgchk doesn't work. Is this correct or where do I go wrong here? |
Well its too early and I have not had my coffee to investigate the coding to confirm or deny although that check works for me and everyone else around which is how this thread got started in the first place. If you think its not returning right name you can try this ;) $irealname = fixfilenames($realname); $irealname = "{$User[userid']}{$realname}"; The issue your reporting above which is very minor and the issue you had PM'd us dont match in the very least as you made some wild claims via PM to Michael and I both that classifieds deletes your forum etc. If you refuse to give ftp, admin access and a url to assist further there is nothing more we can do in a support manner for you. You need to realize there is certain information we need to provide support. You can comply with this or not. |
Well, can you check that I posted above and give a comment if that's a problem and if not where do I go wrong because I think that if this is a bug then it preceeds my problem so it's related and not a minor (I don't think it's appropriate to call a problem that deletes whole VB forum-directory and whole webservice a minor) |
Mikan I posted a tweak above if you think the code is wrong on the image check. I said that was minor and it is the most minor of things realize if you could repost the same image it would harm nothing as it would simply be renumbered much like if I upload an image with the same name. There is not and I repeat this again anything in our code that could delete your vb forums. Its quite that simple. You can scan the code back and forth and you will see I am indeed correct. You repeatedly refuse to give us access/url to assist in seeing this issue so there is nothing more I can say here. You need to understand that if we can not replicate an issue then there is nothing more we can do here without looking at your install. It's your choice if you want assistance or not and this is by count the fifth time I have asked for a url/admin access and ftp between this thread and the prior PM's. |
Quote:
|
| All times are GMT -5. The time now is 12:21 AM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0