 | |  | | | Photopost Pro Installation & Upgrades If you're having install or upgrade problems |
May 11th, 2006, 05:10 PM
|
#1 (permalink)
| | Ultimate Member Verified Customer
Join Date: Sep 2002
Posts: 1,217
| 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
|
| |
May 11th, 2006, 06:13 PM
|
#2 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,692
|
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.
|
| |
May 12th, 2006, 03:38 AM
|
#3 (permalink)
| | Ultimate Member Verified Customer
Join Date: Sep 2002
Posts: 1,217
|
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?
|
| |
May 12th, 2006, 03:59 AM
|
#4 (permalink)
| | Ultimate Member Verified Customer
Join Date: Sep 2002
Posts: 1,217
| Quote: |
Originally Posted by Chuck S 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.
| ...in which file do I find the code you quoted above?
|
| |
May 12th, 2006, 04:37 AM
|
#5 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,692
|
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: |
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?
| If you allow users to delete content from your site sure they can.
|
| |
May 12th, 2006, 04:52 AM
|
#6 (permalink)
| | Ultimate Member Verified Customer
Join Date: Sep 2002
Posts: 1,217
| Quote: |
Originally Posted by Chuck S The query above will tell you how we track the upload it is by userid ... |
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?
|
| |
May 12th, 2006, 05:00 AM
|
#7 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,692
|
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.
|
| |
May 12th, 2006, 05:12 AM
|
#8 (permalink)
| | Ultimate Member Verified Customer
Join Date: Sep 2002
Posts: 1,217
| Quote: |
Originally Posted by Chuck S The line noted is indeed in uploadphoto.php line 118 | mmmmhh,
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...
|
| |
May 18th, 2006, 09:35 AM
|
#9 (permalink)
| | Ultimate Member Verified Customer
Join Date: Sep 2002
Posts: 1,217
|
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
|
| |
May 18th, 2006, 10:27 AM
|
#10 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,692
|
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.
Now only thing I can suggest is if your users are experiencing your PHP shutting down when trying to upload then a non processed file might not be deleted from the uploads directory and this might be why your users have multiple files in there uploads directory. If your using GD2 this might be your case in that case you can try the tweak we post around here to increase your PHP memory limit. But the query structure and how the code performing seems to be fine from looking at your explanation. The only issue I am seeing is as stated if your user has multiple files in the uploads directory which might result in aborted uploads possibly from memory issues and php. You can place this at the top of pp-inc.php near the error_reporting line to increase PHP memory if using gd2 Code: Content visible to verified customers only.
Last edited by Chuck S; May 18th, 2006 at 10:33 AM.
|
| |
May 18th, 2006, 12:56 PM
|
#11 (permalink)
| | Ultimate Member Verified Customer
Join Date: Sep 2002
Posts: 1,217
|
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)
|
| |
May 18th, 2006, 01:25 PM
|
#12 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,692
|
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
|
| |
May 18th, 2006, 03:18 PM
|
#13 (permalink)
| | Ultimate Member Verified Customer
Join Date: Sep 2002
Posts: 1,217
| Quote: |
Originally Posted by Chuck S 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?
| As I mentioned above, it is HARDCODED in image-inc.php. Search for the word "graphic" and you will find at least 3 locations:
--------------
// 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: |
Originally Posted by Chuck S 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. |
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!
|
| |
May 18th, 2006, 03:29 PM
|
#14 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,692
|
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.
|
| |
May 18th, 2006, 03:50 PM
|
#15 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,692
|
Try this in image-inc.php in bold Code: Content visible to verified customers only.
|
| |
May 18th, 2006, 04:54 PM
|
#16 (permalink)
| | Ultimate Member Verified Customer
Join Date: Sep 2002
Posts: 1,217
| Quote: |
Originally Posted by Chuck S What script are you on uploadphoto or bulkupload? | it is uploadphoto.php Quote: |
Originally Posted by Chuck S Try this in image-inc.php in bold Code: Content visible to verified customers only.
| I made the changes above and no wrong error appears anymore  Thanks
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.
|
| |
May 18th, 2006, 05:03 PM
|
#17 (permalink)
| | Ultimate Member Verified Customer
Join Date: Sep 2002
Posts: 1,217
|
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
|
| |
May 18th, 2006, 05:14 PM
|
#18 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,692
|
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
|
| |
May 19th, 2006, 05:50 AM
|
#19 (permalink)
| | Ultimate Member Verified Customer
Join Date: Sep 2002
Posts: 1,217
| Quote: |
Originally Posted by Chuck S 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.
The fix will correct the issue but for users you might want to delete all directories under uploads so they can all start fresh | I deleted all subdirecories of the uploads folder (except "1", I think it is for the admin) and it works now. So now, also the old users, who experienced this problem can properly upload. Thanks.
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: |
Originally Posted by Chuck S Try this in image-inc.php in bold Code: Content visible to verified customers only.
| But the system is only using the wording for too small, no matter what the problem in reality is.
How can I fix this?
|
| |
May 19th, 2006, 08:48 AM
|
#20 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,692
| Code: Content visible to verified customers only.
I do not see anything wrong with Michael's choice of wording there. It never says the image is too small. It says to upload a smaller one cause its too wide or too tall.
|
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Rate This Thread | Linear Mode | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | |
Similar Threads | | Thread | Thread Starter | Forum | Replies | Last Post | | Editing hours upload | pauloo | vBGallery Suggestions | 0 | February 5th, 2006 05:15 AM | | upload limit | cbr929rrerion | Installs and Upgrade - vBulletin 3.5.X | 23 | January 2nd, 2006 04:15 PM | | Upload Limit | The Great Hitoki | How Do I? - vBulletin 3.5.X | 3 | December 23rd, 2005 07:36 AM | | limit upload | Snitz | How Do I? - vBulletin 3.0.X | 2 | May 26th, 2005 03:43 AM | All times are GMT -5. The time now is 12:37 PM. | |