![]() |
PP 5.3: 24 hours upload limit error Hi PP 5.3: 24 hours upload limit error I got now 4 user complaints within the last week about problems with the daily upload restriction. It is seems to be always the same procedure: The user is uploading an image, which was either to big or in the wrong format and did therefore not get accepted. If he/she then tries to upload a different one, the message appears that the upload limit was already surpassed. One user is claiming thta this would be even after 2 days and more. I have the 24 hour limit for 1 image per 24 hours. Since the "wrong image" did not upload, this should not count as a successful upload internally, right? So how can it be that with the next try that message appears? Or did I oversee something? What can be the problem and how to fix this? Thanks in advance |
The user would have to have uploaded a successful image within the 24 hour period from now backwards explicitly. The query is very simple below. It grabs a count of all images the user has uploaded from this minute minus 24 hours. Code: Content visible to verified customers only. |
mmmhhh I can not replicate this neither. But it is strange that I get this complain this week from 4 different users. How does PP track, that a user already uploaded an image? With IP address or only by username? Or something else? Might it be possible, that after a specific behaviour of a user, that a cookie is stored so that PP thinks that he upoaded already? As far as I can see, a user can even delete an image after comments have been made by other users and can upload again a new image in the same 24 hours (which is not good by the way). Could this cuase any kind of cookie problems? |
Quote:
|
The query above will tell you how we track the upload it is by userid so this is a verified actual photo that has been uploaded. Quote:
|
Quote:
mmhhh, so I guess the system can not become "confused" if a user uses 3 different usernames all from the same computer.... What else could be a theoretically a reason for these alerts? Wrong cookies? Specific browser-behaviour? I do not find the 24 hour line in my file. As far as I remember, it was in uploadphoto.php. Did it move in PP 5.3 somewhereelse? |
The line noted is indeed in uploadphoto.php line 118 There is no way the query or anything can be confused. It is a simply query that grabs the number of images the user uploads in last 24 hours. Then the PHP conditional that stops them is as simple as it gets meaning if the amount found is equal to or more than the amount you set in usergroup permissions then stop them. There is no room for error. Code: Content visible to verified customers only. |
Quote:
I think I have still an older modified code in it. from this post: http://www.photopost.com/forum/showt...ghlight=julian I will try to make it again like the original code and will report back later... |
Hi Chuck since the problem did not go away, I made further testings and found the bug: I can repeat the error message every time now under specific circumstances. There are 3 restrictions for uploading images: 1. The image is to big in KB 2. The image is too big in size (pixel) - Max allowable image width/height in pixels = 1000 3. The image is too small in size (pixel)- Min allowable image width/height in pixels = 400 For number one there is no problem. This is what I always tested in the past. A user tries to upload an image which is too big in KB, it gets rejected and he can try with anthother one. No problems at all. But number 2&3 are the trouble shooters. If a user is uploading an image which is too big in pixel (but KB is o.k.), he comes to the second upload screen. When he then clicks on submit, he gets rejected (which is fine), but can not upload afterwards another image. Same procedure and consequence, if he uploads an image, which is to small in pixel (not KB). Same error message, same consequences. So the bug is, that photopost checks always first only the KB size, not the pixel size. If KB is correct, it seems to upload the image on the server already (not yet visible in the gallery). Only after that step it checks whether the image is too big/small in pixelsize. But this is too late. As a result, IMHO the image is already on the server and this leads to the error that he uploaded already an image within the last 24 hours. How can I fix this? Thanks in advance P.S.: 2 other minor problems for the same issue: The alert sais ALWAYS that the graphic is too small (pixel), although it is sometimes too big (pixel). So the wrong error message appears, if the image is too big. Secondly the text is hardcoded in image-inc.php |
If the image has not been processed it does not count against the count. Only files already processed and in the photos table count towards the uplimit count. Now if your doing uploads and there are multiple files to process when uploading yes he will get cut off when processing as in two files are in the uploads directory one processes and you loop again then you will get stopped. This does not indicate a bug that I see if you are only allowing say 1 upload and he is trying to do 2 At every point in both uploadphoto and bulkupload we issue this query which only pulls the photos that have been processed Code: Content visible to verified customers only.Code: Content visible to verified customers only. |
I do not think that this is a memory problem. All tests we made have always been with only one photo. Not several ones in the upload window. All photos have been between 29KB and 129KB, so a memory issue with GD2 is very unlikely. On the same server in a different PP 5.3 install, I can upload files with 8MB and I do not have a memory issue. No I do think that Photopost is treating an image differently, depending on whether the file exceeds the KB restrictions or not. This is the only difference when uploading the image whether it makes problems or not. If the image is below the KB threshhold, you can go one step further in the upload process. And this one step IMHO is guilty for errors later on. As I said before: If the image is too big in KB size, the user can not upload it, BUT he can upload another one immediately. BUT if the same user is uploading an image that is small in KB enough, but Pixel size is not in the allowed range, Only then he will see the next screen of the upload process. And only after getting rejected on this next sreen, he will get problems later on. It is very easy to replicate this error. You can go to my gallery and try it. I will send you the URL by mail. File restrictions are: Max. 130KB Minimum 400x400 pixel Maximum 1000x1000 pixel 1 upload with 24 hours. So only try it with an image i.e. 350x400 pixel and 50KB and you will see what I mean. You will first get the message that the graphic is too small and when you AFTER this try to upload another one (since your first one was too small and therefore was not accepted), you get the alert that you uploaded already within the last 24 hours an image and have no right to upload now another one. (i changed the text of all alerts from daily upload limit to 24h) |
too small? I dont find anywhere in our program where we call a diewell that a graphic is to small what is the exact error? Second yes if your using bulkupload you are uploading more than one file because $uploadchk counts up 1 for each file it processes which is going to include all files uploaded so your not processing 1 but 2 files. This is what I have been saying your trying to upload multiple files and it will trip the trigger in bulkupload. It counts for each image uploaded and if your doing multiple files. If you where uploading one file at a time in uploadphoto.php this logic is not present and you would only be dealing with one file. The query structure is sound in both files. Your issue is your going to bulkupload to process multiple files and regardless if a file processes or not it is counted. as every image processed on bulkupload has a count. The query is returning 0 1 whatever like it should. Your issue is with the count on bulkupload with the multiple images. Thats the trigger |
Quote:
-------------- // Too big? if ( $imagewidth > $maxwidth ) { if ( $Globals['resizeorig'] == "yes" ) { $resizeorig = 1; } else { @unlink($realname); diewell("Your graphic is too wide!<br /><br />Please upload a smaller one."); } } if ( $imageheight > $maxheight ) { if ( $Globals['resizeorig'] == "yes") { $resizeorig = 1; } else { @unlink($realname); diewell("Your graphic is too tall!<br /><br />Please upload a smaller one."); } } // Too small? if ( ($Globals['minwidth'] > 0 && $imagewidth < $Globals['minwidth']) || ($Globals['minheight'] > 0 && $imageheight < $Globals['minheight']) ) { @unlink($realname); diewell("Your graphic is too small!<br /><br />Images must be at least {$Globals['minwidth']}x{$Globals['minheight']}."); } --------------- Quote:
Secondly, as I said, there is only ONE image the user tries to uplaod at a time. So this can not be a bulkupload issue. I just do not understand why you try to argue that it is not a mistake of the software. Did you even tried to repeat the same steps in my installation? It does not matter what the code looks like. It matters what the result of the code is. It is not acceptable, that if a user tries to upload ONE image at a time, which is too small, fails, he logs out, logs in and tries again ONE image at a time, that now the system states that he uploaded already an image within the last 24 hours. This is simply not true! There is no other image visible in the gallery of that user, he did not succeed to upload any image within these 24 hours, so the message of the system is wrong. If you try to open a bottle of water, do not succeed to open it, throw it way, take another bottle and want to open it, then IT IS NOT correct, if the second bottle sais: "You have drunken already a bottle of water". It is just not true. Sorry, but this is a bug or whatever you prefer to call it and it needs to be fixed! |
What script are you on uploadphoto or bulkupload? This is the issue I am seeing if you go to bulkupload you will get this because of the image count issue. I will do some testing but this will not be a quick answer. |
Try this in image-inc.php in bold Code: Content visible to verified customers only. |
Quote:
Quote:
The only left issue is the text of the message. It is always the same message, ignoring whether the image is to small or too big (both for pixelsize). So if I upload an image which is too big in pixels (in my case over 1000 pixel), then the message appears that the image is too small, with the hint it has to be at least 400x400 pixel. But in reality, it is too big. It seems that there should be also a different alert message, depending on whether the image width or height is too big or too small, because in the hardcoded text of image-inc.php it is written "too tall" and "too wide". So this would needed to be fixed too. |
Update: there seems to be a cookie problem. For all tests, I always created a new user account and made the Tests with new uploads. The bugfix above solved that issue. But if I use now an older account, which experienced the bug a few hours ago, the wrong message still appears. This is strange since both accounts have to use the same script, right? I deleted all Cookies in my browser (firefox, newest edition), but same problem. Still no problem at all with my other new account thanks to the fix. What do I have to delete so that the other account works too? My settings in admin/global options: ------------------------- Use photo view caching to reduce view update queries on high load sites? NO Load limit for server? 0 Use category cache? YES Minutes to cache index page data for featured photos, statistics and PALs? 0 |
It is not a cookie issue at all. The changes I made changed the line to make sure it deletes the file out of the upload directory of the user. This is why as stated before by me you where being sent to bulkupload and triggering that error cause it was processing two files. The old file not uploaded and the new file you where trying to upload ;) The fix will correct the issue but for users you might want to delete all directories under uploads so they can all start fresh |
Quote:
So the last thing to change would be the text of the alert. How can I make sure, that the proper message for the error appears? If you look at the code, there is a wording for too small, too wide and too tall. Quote:
How can I fix this? |
Code: Content visible to verified customers only. |
| All times are GMT -5. The time now is 07:49 AM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0