Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

SWFUpload file size algorithm broken


Go to End


3 Posts   1563 Views

Avatar
Ryan M.

Community Member, 309 Posts

29 July 2010 at 3:23pm

I'm not sure what's wrong but the algorithms for calculating file sizes are broken in SWFUpload.

For example, I have the max upload size set to 400M via SWFUploadConfig. However, it's refusing files 400M or smaller. Perplexing. So I threw it into debug mode and in the debug output I found out it was somehow converting to 409600 bytes. That only comes out to 0.4M... no wonder my files were getting turned down.

Anyway, I got around this by setting it to an absurd 400000M. :) But does anyone know if this is a known bug, if there is a solution?

Stats:

SS 2.3.6 hosted on CentOS server
SWFUpload Version 2.2.0 Alpha

Avatar
UncleCheese

Forum Moderator, 4102 Posts

29 July 2010 at 3:42pm

Kind of a tricky one, here. Look at /swfupload/_config.php, and you'll see how the file_size_limit is assigned to the JS object. SWFUpload wants you to use the unit "MB", not "M". Kind of silly, and should be idiot-proofed, but I'm sunsetting this module very soon in favor of a much more flexible and extensible plugin that hopefully won't give us this much grief.

Avatar
Ryan M.

Community Member, 309 Posts

29 July 2010 at 3:55pm

Yes, I see a str_replace on line 10 which apparently is an attempt at idiot-proofing it.