Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Image file upload size problem
Avatar
BSABantam
UK
Member
Free Members
sp_UserOfflineSmall Offline
Jul 30, 2017 - 4:42 pm

We have a 1Mb size limit enabled (1048576 bytes) on our Forum but despite the file size reported by the OS being under 1Mb, a 106 error is generated. This is confusing our Members as the figures don't appear to make sense.

In the example below, 4 files were set to upload, until the 'Start Upload' button is clicked they all show the same size as reported by the OS, however, as the upload starts, the file is reported at more than double the size and obviously the upload fails and I can't understand why!

Any ideas?

Screenshot01.pngImage Enlarger

Screenshot02.pngImage Enlarger

I should say that the file upload used to work as expected but at some point (not sure when) something has changed and now we are getting the error.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 30, 2017 - 6:28 pm

does that one file you say is reported as the wrong file size upload by itself?  what about the other ones (the other three)?  you mentioned four, but screenshot only shows 2...

when the upload generates the error, can you look at the file in the server temp directory (typical unix would be /tmp)...  the file that was just uploaded to the server is being reported by that OS of being over the 1M limit...  

if you cant see it in the temp dir, can you ftp it up and see the reported size?  

just trying to see for sanity since the server via php and the $_FILES global tells us what the file size is...

Avatar
BSABantam
UK
Member
Free Members
sp_UserOfflineSmall Offline
Jul 31, 2017 - 4:02 pm

All 4 files failed, all 4 files were being shown as under 1Mb before uploading started, in fact they were all shown as identical to the file sizes shown in the Terminal screenshot, I took the screenshot at that point to show that as soon as the upload starts the file size jumps up, in that case to 2.7Mb. You can see that the final file is reported as 989kb but when the upload started it too jumped up in size and failed.

Couldn't find any of the files in the temp dir so I transferred by ftp and despite the size shown in the Terminal, the ftp program shows the size as 1.1Mb on both my system and the server. That would explain why it fails as it's over 1Mb but it doesn't explain why it's reported as under 1Mb before upload or the massive jump in reported size on upload!

Screenshot04.pngImage Enlarger

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 31, 2017 - 8:55 pm

I assume its two different OS'es??  each OS can report different size...  usually based on block size...  they will have a smallest size they can represent so  you may get varying different sizes...  quick example: https://askubuntu.com/question.....ng-systems

Avatar
BSABantam
UK
Member
Free Members
sp_UserOfflineSmall Offline
Aug 1, 2017 - 7:58 am

Yes, 2 different versions of Linux surprisingly reporting different sizes!

Thanks for the link, I ran the commands given on my own Linux system and got 996k & 1.1Mb.

Screenshot05.pngImage Enlarger

Windows 7 reports 994KB for the same file.

As for what changed, the only thing I can think of is that we had our Site updated about 9 months ago and I suspect the Server OS may have been updated at the same time.

The confusion appears to arise when we tell our Members there is a 1Mb upload limit, most of whom will be running a version of Windows which will tell them their file is under the limit when the Web Server & thus SP says it is over size!

Perhaps I should increase the upload limit to 1153435?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Aug 1, 2017 - 8:52 pm

yes, that is what I would do... or at least some number in that range 😉

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625