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: 4243 Views
  • brice
    Avatar
    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:

    %2Fpaulickreport%2Fadmin%2FEditForm%2Ffield%2FPhotos%2FUploadifyForm%2Ffield%2FUploadedFiles%2Fupload%3Fctf%5BPhotos%5D%5Bstart%5D%3D0%26ctf%5BPhotos%5D%5Bper_page%5D%3D10%26ctf%5BPhotos%5D%5Bshowall%5D%3D0%26ctf%5BPhotos%5D%5Bsort%5D%3D%60NewsPost_Photos%SortOrder%26ctf%5BPhotos%5D%5Bsort_dir%5D%3D%26ctf%5BPhotos%5D%5Bsearch%5D%3D%26ctf%5BPhotos%5D%5Bfilter%5D%3D%26ctf%5BPhotos%5D%5Bview%5D%3D%26ctf%5BPhotos%5D%5Bonly_related%5D%3D

    to

    %2Fpaulickreport%2Fadmin%2FEditForm%2Ffield%2FPhotos%2FUploadifyForm%2Ffield%2FUploadedFiles%2Fupload

    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
    Avatar
    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
    Avatar
    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 (:

    4243 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.