Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Uploadify IO error on Mac (fix / patch)

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 4248 Views
  • brice
    Community Member
    51 Posts

    Uploadify IO error on Mac (fix / patch) Link to this post

    I ran across an issue when using Uploadify within HasMany/ManyMany FileDataObjectManager fields. I would get an IO error (#2038) on the Mac platform ... but not on Windows/PC.

    After trying & reading everything.. it *appears to me* that the issue is related to a character limit of flashvars on the Mac platform.

    As a workaround, attached is a patch that shortens the "script" flashvar passed to the [jQuery] Uploadify plugin. In short; it removed superfluous URL info that ComplexTableFields add. E.g. it changes:




    Below is the patch to code/UploadifyField.php

    Index: www/uploadify/code/UploadifyField.php
    --- www/uploadify/code/UploadifyField.php   (revision 145)
    +++ www/uploadify/code/UploadifyField.php   (working copy)
    @@ -418,8 +418,16 @@

          if($this->form) {
             if(!$this->getSetting('script')) {
    -            $this->setVar('script',urlencode(Director::baseURL().Director::makeRelative($this->Link('upload'))));      
    +            // long script strings cause IO error on Apple/Mac Flash platforms\
    +            // so parse out complextablefield

    +            $script = urlencode(Director::baseURL().Director::makeRelative($this->Link('upload')));
    +            if($pos = strpos($script,'%3Fctf'))
    +            {
    +               $script = substr($script,0,$pos);
    +            }
    +            $this->setVar('script',$script);
             if(!$this->getSetting('refreshlink')) {
                $this->setVar('refreshlink', Director::baseURL().Director::makeRelative($this->Link('refresh')));

  • brice
    Community Member
    51 Posts

    Re: Uploadify IO error on Mac (fix / patch) Link to this post

    Cleaned up patch is available @ https://github.com/briceburg/Uploadify/commit/d5d0bea81c393d8fe8d5fb654ddf836ffb00cbaa -- a pull request has been sent to get this into the official Uploadify git repository at GitHub. New patch is more effective.

  • qbahamutp
    Community Member
    8 Posts

    Re: Uploadify IO error on Mac (fix / patch) Link to this post

    Thanks so much for this, brice. This just got us out of a little bind that otherwise might've taken ages.

    Cheers dude (:

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.