Uploadify + FileDOM: Together at Last

1 Sep

Uploadify + FileDOM: Together at Last

It was only six days ago that I released Uploadify, and the feedback has been very positive so far. Thanks to everyone for their testing and continued support!

There has been one comment that seems to be consistent among almost all testers, however, and it goes something like, “I love it! Now how and when can I integrate this with FileDataObjectManager?” As of today, that is now possible.

How can it be done? It’s pretty seamless, actually. If you have the latest versions of DataObjectManager, Uploadify, and ImageGallery (if applicable), your File or Image DataObjectManager will detect if you have Uploadify installed, and if so, the SWFUpload field will be replaced by Uploadify.

Also bundled in the latest release of Uploadify are several bug fixes related to broken or malformed paths, which were causing HTTP errors for some users, and new authentication methods that will work with environments where session_use_only_cookies is on.

Enjoy this happy marriage of these two great SilverStripe modules!

70 Responses to “Uploadify + FileDOM: Together at Last”

  1. Stijn De Lathouwer 01. Sep, 2010 at 2:32 pm #

    Great news. Sounds easy to upgrade.

  2. Lamin Barrow 01. Sep, 2010 at 3:55 pm #

    I think i may have found a bug with imports and uploads failing on a remote server.. but where do i report them?

    You deserve a big thanks from the entire Silverstripe community. Well done Uncle Cheese. Nice work and Thanks. (y)

    • unclecheese 01. Sep, 2010 at 4:18 pm #

      What is the bug? How can I replicate it?

      • Lamin Barrow 02. Sep, 2010 at 12:51 pm #

        Uploads work on my dev machine but they where failing on the remote server and the flash upload reported a HTTP Error.

        I tried importing files already uploaded to another folder but somehow, it seems it can’t figure out the multiple files i imported where images after i finished importing them and it showed only blank thumbnails. I refresh the page the images where are suppose to the related to in the front but only the image Titles where shown in this format #35 #45 etc.

        I hope this helps.

        • unclecheese 02. Sep, 2010 at 3:22 pm #

          Hi, Lamin,

          For the uploader that’s failing, can you add “UploadifyField::show_debug();” to your _config.php and show me the output?

          • Lamin Barrow 02. Sep, 2010 at 10:03 pm #

            Here is the debug output. I hope that helps.

            script: /es/admin%2FEditForm%2Ffield%2FSlides%2FUploadifyForm%2Ffield%2FUploadedFiles%2Fupload%3Fctf%5BSlides%5D%5Bstart%5D%3D0%26ctf%5BSlides%5D%5Bper_page%5D%3D10%26ctf%5BSlides%5D%5Bshowall%5D%3D0%26ctf%5BSlides%5D%5Bsort%5D%3D%26ctf%5BSlides%5D%5Bsort_dir%5D%3D%26ctf%5BSlides%5D%5Bsearch%5D%3D%26ctf%5BSlides%5D%5Bfilter%5D%3D%26ctf%5BSlides%5D%5Bview%5D%3Dgrid%26ctf%5BSlides%5D%5Bimagesize%5D%3D100
            refreshlink: /es/admin/EditForm/field/Slides/UploadifyForm/field/UploadedFiles/refresh?ctf[Slides][start]=0&ctf[Slides][per_page]=10&ctf[Slides][showall]=0&ctf[Slides][sort]=&ctf[Slides][sort_dir]=&ctf[Slides][search]=&ctf[Slides][filter]=&ctf[Slides][view]=grid&ctf[Slides][imagesize]=100
            uploader: /es/uploadify/javascript/uploadify.swf
            scriptAccess: sameDomain
            queueSizeLimit: 40
            auto: 1
            fileExt: *.jpg;*.JPG;*.jpeg;*.JPEG;*.gif;*.GIF;*.png;*.PNG
            fileDesc: Images
            cancelImg: /es/uploadify/images/cancel.png
            image_class: SlideShowImage
            file_class: File
            buttonText: Cargar (sólo imágenes)
            queueID: UploadifyFieldQueue_UploadedFiles
            wmode: transparent
            hideButton: 1
            upload_on_submit:
            sortable:
            multi: 1
            scriptData:

          • unclecheese 03. Sep, 2010 at 9:53 am #

            What happens if you put a die(‘hello’); statement on the first line of UploadifyField::upload()?

        • unclecheese 02. Sep, 2010 at 4:41 pm #

          For the images, you won’t see thumbnails if your uploader isn’t corresponding to an Image class. If you have your relationship set up as:

          $has_one = array (
          ‘SomeFile’ => ‘File’
          );

          Then files are what will get imported, which do not have the GD functions built in.

          • Lamin Barrow 02. Sep, 2010 at 10:06 pm #

            I have the following

            static $has_many = array (
            ‘Slides’ => ‘Slide’ );

            and the Slide Dataobject has one SlideShowImage which is an extension of the image class with custom generate functions.

          • Lamin Barrow 03. Sep, 2010 at 6:50 pm #

            I tried adding the die(‘hello’); at the at first line of the UploadifyField::upload(); funtion but nothing happend.

            For your information the website is hosted on the Rackspace cloudsites platform. We had similar issues with the SWFUpload module in some of the past revisons. Can the uploadify field uploader use a simple html form file as an option for uploads?

          • unclecheese 03. Sep, 2010 at 8:04 pm #

            Could you please send me a link to the site? I can packet sniff it and get the error. Just make sure your site is in dev mode, and the PHP value display_errors is on.

            You can send the link to me through the contact form on this site if you don’t want it public.

  3. John 01. Sep, 2010 at 4:02 pm #

    does this mean s3 files will work with FileDataObjectManager

    • unclecheese 01. Sep, 2010 at 4:21 pm #

      That would require a pretty simple incremental change. I’m going to see how testing goes with this and then we can roll S3 into FileDOM.

      • John 01. Sep, 2010 at 4:38 pm #

        Sweet. Looking forward to it.

        • sdiddy 16. Nov, 2011 at 11:17 am #

          +1 !!! Will stay tuned… Thanks unclecheese ;-)

  4. Andrew Houle 01. Sep, 2010 at 4:33 pm #

    Awesome news! My only hangup is that the order bug for DOM seems to still exist, where the order flip flops when drag and drop is checked. Is that still a known bug with this version?

    On a sidenote (hopefully not too off topic), I can’t get a global DOM width to work using something like this in my config DataObjectManager::set_popup_width(600) Am I missing something there?

    • unclecheese 01. Sep, 2010 at 6:07 pm #

      The re-ordering bug should be fixed now. I’m not sure about the set_popup_width() issue. I’m not able to replicate that one. You might want to try passing “600” as a string?

      • Andrew Houle 02. Sep, 2010 at 11:08 am #

        Awesome, I see the sorting bug is fixed in rev 477 (476 flip-flopped).

        Still no luck on the global popup width. I’ve tried…
        DataObjectManager::set_popup_width(600);
        DataObjectManager::set_popup_width(‘600′);
        DataObjectManager::set_popup_width(“600″);

        Any suggestions?

        • unclecheese 02. Sep, 2010 at 11:17 am #

          You know, it occurs to me that the default popup width, since the Uploadify release, has been changed to 640, so you’re probably not going to see a huge difference with 600. What happens if you do 1000?

          And you’re not overriding the default anywhere with $dom->setPopupWidth()?

          • Andrew Houle 02. Sep, 2010 at 3:00 pm #

            I just tried it on a fresher site with hardly anything installed, trying to avoid any strange conflicts, but no dice. I’m using the newest DOM (477). In this case it’s a very simple D.O. no uploadify necessary. I get a really small DOM box by default, complete with horizontal and vertical scrollbars.

            Here is a screenshot of the popup – http://www.andyhoule.com/downloads/dom.png and here is the config file – http://www.andyhoule.com/downloads/config.png

            It’s not a problem to set these individual (that works), but I’m not sure how to do that without hacking the core for the events or image gallery modules, so it’d be nice to set the width globally.

          • unclecheese 02. Sep, 2010 at 3:23 pm #

            The way the width is passed to the popup is through the “rel” attribute of the link that opens it, e.g. rel=”500″ Can you check that those rel tags are responsive to the changes you’re making?

  5. Andrew Houle 02. Sep, 2010 at 3:36 pm #

    The links have an empty rel attribute… rel=””

    • unclecheese 02. Sep, 2010 at 4:04 pm #

      Wow. And this is a regular DOM? I’ve got no idea, dude.

      • Andrew Houle 02. Sep, 2010 at 4:15 pm #

        Sucks. So the default behavior is suppose to be a width of 650? Maybe I’ll try a base install for the heck of it. I’ll let you know if I figure out anything.

        • Andrew Houle 03. Sep, 2010 at 1:09 pm #

          Not suprisingly everything works on a fresh install… I’m looking for what is conflicting now.

          • Andrew Houle 03. Sep, 2010 at 1:31 pm #

            The base install works on my personal server (andyhoule.com) but not on my work’s server. There must be a setting difference. Any ideas what I could check?

          • unclecheese 03. Sep, 2010 at 1:52 pm #

            What exactly isn’t working?

  6. Christopher 02. Sep, 2010 at 3:51 pm #

    When you go onto the “Choose Existing” tab and click import nothing happens, nothing shows up in firebug either. Anyone else getting this problem?

    ss 2.4.1
    latest dom
    latest uploadify

    • unclecheese 02. Sep, 2010 at 4:34 pm #

      Can you replicate it on the demo site? http://dataobjectmanager.carlinowebdesign.com/admin

      u: admin
      p: password

      • Christopher 08. Sep, 2010 at 6:22 am #

        No, it seems to work OK on the demo site. Will upgrade my copies to the latest SVN and let you know if it’s still not working.

        Thanks

  7. Andrew Houle 03. Sep, 2010 at 10:52 am #

    Everything seems to work well on the demo site. Do you know what version of DOM and uploadify are on there?

    • unclecheese 03. Sep, 2010 at 11:25 am #

      Always the latest. That site is my sandbox for changes, so if anything, it’s ahead of SVN.

  8. Aram 03. Sep, 2010 at 11:26 am #

    Hi UC, thanks for the great module :)

    When using FileDOM in ModelAdmin with Uploadify I get the following error:

    Error: DataObjectManager requires the SWFUpload module

    Also when using Uploadify on it’s own in ModelAdmin the styling is all awry and seems to be missing page elements such as the tabs for upload new or import existing. Has it been tested with ModelAdmin before?

    I am using the latest trunk of both (479) with SS 2.4.1.

    Aram

    • Aram 03. Sep, 2010 at 11:38 am #

      Sorry my bad, I was too quick to get rid of SWFUpload! It fileDOM works with Uploadify when I reinstate swfupload.

      ModelAdmin issues remain though, and this goes for the FileDOM popup too…also files don’t seem to be attached to the ModelAdmin DO at all.

      I’m guessing this all points to the fact that it’s not ModelAdmin ready just yet?

  9. Andrew Houle 03. Sep, 2010 at 2:08 pm #

    This is still in reference to the width of the DOM popup. On my one server it seems like the getSetting function doesn’t work for the popupWidth on line 580 of DataObjectManager.php. It returns a null value and places that in the rel attribute. If I hardcode a string instead, that seems to work. I’m pretty sure there is nothing wrong with your code, because it works fine on my personal site’s server, but not on any of the sites hosted on my work’s server. Any chance it could be a php version issue? The NU server uses php 5.1… just think aloud, I’ll keep looking.

    • Matthew Balaam 06. Sep, 2010 at 7:59 am #

      I’ve seen that same problem with the pop-up window before trying to run a site on a server with PHP 5.1x (sorry can’t remember exactly which version)

      In the end I switched to a provider with PHP 5.2x instead which removed the issue. I hope this is a help, although possibly not a solution you can use.

      • Andrew Houle 08. Sep, 2010 at 9:09 am #

        Just upgraded the server to 5.2.1 but it still doesn’t work. I wonder what other server settings could be causing this road block. Has anyone else run into this problem?

        • unclecheese 08. Sep, 2010 at 9:57 am #

          See this thread: http://www.silverstripe.org/dataobjectmanager-module-forum/show/291809?start=8#post291826

          Could you PM me your FTP info so I can jump in and figure this out?

          • Andrew Houle 08. Sep, 2010 at 3:35 pm #

            The system administrator hadn’t restarted apache since upgrading php. Once he did, magic, it started to work. Sorry for clogging up the comments, hopefully this helps someone else down the road.

          • unclecheese 08. Sep, 2010 at 3:56 pm #

            Are you serious? That’s crazy. What were the two PHP versions, old and new? Could you add a comment to that forum post I sent you?

          • Andrew Houle 09. Sep, 2010 at 7:41 am #

            It was 5.1.x and now the server is on 5.2.10

  10. Jean-Pierre Bécotte 07. Sep, 2010 at 1:36 pm #

    WOW! This module adds a great value on the websites I am working on! My clients will be impressed!

    Thanks! Good job!

    • wainui 14. Sep, 2010 at 5:55 am #

      Hey Uncle Cheese,
      Thanks for all your help previously.

      I just tried your uploadify in a nested in a DOM.
      A couple of problems..
      1] could not upload got an 500 error.
      2] Popup size for nested DOM was way to small for uploadify.

      I could however import from existing folders.

      • unclecheese 14. Sep, 2010 at 11:19 am #

        For the 500 error, can you add “echo ‘hello';” to the first line of UploadifyField::upload()? Let me know if you get an alert message with an error.

        The popup size is a very bizarre issue. It seems very rare and isolated, and the best thing I can figure out is that it’s related to a specific version of PHP. Can you read up on this thread and get back to me? http://www.silverstripe.org/dataobjectmanager-module-forum/show/291809?start=8#post291826

        • wainui 14. Sep, 2010 at 5:50 pm #

          Hey, just figured out the upload thing.. went back to swfupload and got a bad class name warning (empty class anme in file table. So fixed that and upload through nested uploadify worked great. Will check out that thread and get back to you.

  11. wainui 14. Sep, 2010 at 6:09 pm #

    Hi Checked out that thread…
    My source code has rel=”640″ in the pop-up link.

    But is defaulting back to 450px. I looked at css and it is set at 450 in

    http://localhost/hallertau/www/dataobject_manager/css/dataobject_manager.css?m=1283137226

    .iframe_wrap (line 184)

    {

    width: 450px;

    I change this which changed the popup but not the iframe.
    Will have another look thorugh and let you know how I get on

  12. wainui 14. Sep, 2010 at 7:05 pm #

    Hey Uncle Cheese..
    this line here in dataobject_manager.js line 29. Sets the nested Iframe to 450px. I tweaked that to 640ps as well as changing the css above and all working great :)

    // For Nested DOMs
    if(nested) {
    $(‘body’).append(
    $(‘close‘)
    );

  13. wainui 14. Sep, 2010 at 7:06 pm #

    woops…. is stripping my code out.

    // For Nested DOMs
    iframe src=”” frameborder=”0″ width=”450″ height=”1″

    • unclecheese 15. Sep, 2010 at 10:45 am #

      Yeah, NestedDOM is a second-class citizen.. purposefully, actually. I think it should be used sparingly. 600px popups within another popup make me really wonder if I’m on the right track.

  14. Oscar 15. Sep, 2010 at 6:37 pm #

    I have the same problem in the popup: no rel given in the button link. Tried a lot but no succes.

    For now I have have changed in dataobject_manager.js:

    w = 650; //$(this).attr(‘rel’);

    Anther issue is that on all pages where Uplodify is used I get a message that the page is not saved when I want to go to another page.

    But this is a really usefull module! Thanks!

  15. Boris PADONOU 09. Oct, 2010 at 1:09 pm #

    Good work UNCLE CHEESE

  16. Patrick 11. Oct, 2010 at 7:58 am #

    Hey Uncle Chees.

    Thanks for that great Module.
    Is there anywhere an en_EN.php Translation File?
    I would translate it into german.

    Thanks!

  17. Zauberfisch 13. Nov, 2010 at 12:34 am #

    blubb

    just installed ss2.4.3 and dom + uploadify trunk
    when i open a popup for dom (to edit a entry) its empty.

    the problem seems to be a wrong link for the iframe:

    how it looks:
    admin/assets/EditForm/field/Files/item/4?SecurityID=20443/edit?ctf[Files][start]=0&ctf[Files][per_page]=10&ctf[zauberfisch]=awesome&ctf[Files][sort]=SortOrder&ctf[Files][sort_dir]=&ctf[Files][search]=&ctf[Files][filter]=&ctf[Files][view]=

    how the link should look like:
    admin/assets/EditForm/field/Files/item/4/edit/?SecurityID=20443&ctf[Files][start]=0&ctf[Files] …

    fix is simple:
    Dataobjectmanager.php Line 639
    http://paste2.org/p/1087589

    thanks for your work ;)
    greetings <°(((-<

  18. Alexis 01. Dec, 2010 at 4:00 am #

    love your work UncleCheese!

  19. Zauberfisch 20. Dec, 2010 at 4:08 am #

    currently you can use ->allowUploadFolderSelection() to allow the user to select a upload folder, but I haven’t found a way to denied it

    using a one week old trunk of DOM & Uploadify

    http://paste2.org/p/1152290

  20. labesk 22. Dec, 2010 at 7:02 am #

    Hi,

    i have a problem with uploadify only with firefox. I have a HTTP error while i try uploading a file. I try with IE8 and no problem.
    Then, i have try to desactivate plugins and module in firefox, no result.
    I have try a update shockwave and flash player, no result.
    Any ideas ?

    (sorry for my english)

  21. Gabe Hayes 10. Jan, 2011 at 9:39 pm #

    Yo UncleCheese,

    Great work, your modules have helped me make this project I’m wrapping very attractive and scalable.

    I know you’ve gotten this a lot, but I’m having a similar issue like those mentioned above. Everything was running fine locally, pushed it over the shared hosting (DreamHost), and I get ‘HTTP Error’ when attempting to upload any file, from any page. First thing I did was make sure my assets folder was writable…check.

    Next, enabled debugging on UploadifyField:
    ==========
    script: %2Fadmin%2Fassets%2FEditForm%2Ffield%2FFiles%2FUploadifyForm%2Ffield%2FUploadedFiles%2Fupload%3FSecurityID%3D76193024%26ctf%5BFiles%5D%5Bstart%5D%3D0%26ctf%5BFiles%5D%5Bper_page%5D%3D10%26ctf%5BFiles%5D%5Bshowall%5D%3D0%26ctf%5BFiles%5D%5Bsort%5D%3DSortOrder%26ctf%5BFiles%5D%5Bsort_dir%5D%3D%26ctf%5BFiles%5D%5Bsearch%5D%3D%26ctf%5BFiles%5D%5Bfilter%5D%3D%26ctf%5BFiles%5D%5Bview%5D%3D
    refreshlink: /admin/assets/EditForm/field/Files/UploadifyForm/field/UploadedFiles/refresh?SecurityID=76193024&ctf[Files][start]=0&ctf[Files][per_page]=10&ctf[Files][showall]=0&ctf[Files][sort]=SortOrder&ctf[Files][sort_dir]=&ctf[Files][search]=&ctf[Files][filter]=&ctf[Files][view]=
    uploader: /uploadify/javascript/uploadify.swf
    scriptAccess: sameDomain
    queueSizeLimit: 40
    auto: 1
    fileExt: *.*
    fileDesc:
    cancelImg: /uploadify/images/cancel.png
    image_class: Image
    file_class: File
    buttonText: Upload files
    queueID: UploadifyFieldQueue_UploadedFiles
    wmode: transparent
    hideButton: 1
    upload_on_submit:
    sortable:
    sizeLimit: 7340032
    multi: 1
    scriptData:
    ==========

    Tried echoing and dying on the first line of UploadifyField::upload() and got nothing.

    I know you’ve mentioned packet sniffing to get the error details, do you have an example of this somewhere?

    Again, awesome work, you’ve managed to make SS fun :)

    P.S.
    The pasted stuff from above is when trying to upload a file to the Uploads folder in the Files/Images section of the CMS.

  22. Gabe Hayes 11. Jan, 2011 at 12:50 am #

    Well, I feel stupid, but I figured it out. Since I pushed the site to the host via an svn checkout, it didn’t pull assets/.htaccess over (which I didn’t even know was there, ’til now).

    Also, had to add a little snippet found here, http://doc.silverstripe.org/upgrading:2.4.3#importantif_you_are_running_php_as_fastcgi_with_apache, since DreamHost is running apache with FastCGI.

    Thought this info may be useful to others should they run into the same problem.

  23. Marijn Kampf 21. Jan, 2011 at 10:50 am #

    Hi UncleCheese, it would be great to be able to set default folder for ‘Choose existing’ tab and to be able to default to this tab rather than the ‘Upload new’ tab.

  24. Reegan 03. Feb, 2011 at 9:51 am #

    Hi There,

    I have a small problem thats being killing me for days. I followed all the instructions and installed dataobjectmanager, uplodify and imagemanger.

    All works well and I am able to upload pics and create a new gallery pages.

    However the in the backend(CMS) the look and feel of the album is nothing near what we see in your screencast…

    For example, there is no slider to increase or decrease the size on the images on the fly.

    There is no upload one tab or upload many tab.

    Please help with this.

    Thanks
    Reegan

  25. Fotograf Chojnice 25. Feb, 2011 at 4:46 am #

    Hi everybody!

    I have a problem with displaying a link to the uploaded files, I started a new forum topic: http://silverstripe.org/general-questions/show/15953 # post299570

    Does anyone know where is wrong?

  26. bunheng 06. Jun, 2011 at 2:04 am #

    is it possible to set default view to list view? another thing is while I am create new resource it always let me upload file first, I would like to fill out first and then upload.

    Any possible way.

    Thanks
    Bunheng

    • unclecheese 08. Jun, 2011 at 11:21 pm #

      You can use $yourDOM->setDefaultView(“list”);

      If you don’t want the upload interface, you should use a standard DataObjectManager, not FileDOM.

  27. bunheng 06. Jun, 2011 at 3:58 am #

    I found solutions on your video training on youtube.

  28. flosen spierala 28. Jun, 2012 at 7:41 am #

    hey uncle cheese!
    will uploadify work in silverstripe 3?
    i would really like it!
    cheers,
    Florian

    • unclecheese 28. Jun, 2012 at 10:12 am #

      See my most recent blog post. :)

      • John Peter Bec 21. Aug, 2012 at 11:16 am #

        Which post blog are you referring to?

  29. Ravi 18. Feb, 2013 at 2:33 am #

    hi unclecheese,

    When i am uploading images in uploadify module, it giving error bad request(invalid hostname) in firefox browser only. few days back in firefox browser the images uploading are working fine in the uploadify module. now it is only working in google chrome.

    please give me the solution for this problem, i am searching for 2 weeks to find out this problem.

    please its very urgent for me.