Jump to:

10854 Posts in 2518 Topics by 1794 members

All other Modules

SilverStripe Forums » All other Modules » SWFUpload file size algorithm broken

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 996 Views
  • Ryan M.
    Avatar
    Community Member
    309 Posts

    SWFUpload file size algorithm broken Link to this post

    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

  • UncleCheese
    Avatar
    4085 Posts

    Re: SWFUpload file size algorithm broken Link to this post

    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.

  • Ryan M.
    Avatar
    Community Member
    309 Posts

    Re: SWFUpload file size algorithm broken Link to this post

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

    996 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.