Jump to:

10928 Posts in 2612 Topics by 1809 members

All other Modules

SilverStripe Forums » All other Modules » SWFUpload Documentation

Discuss all other Modules here.

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

Page: 1 2
Go to End
Author Topic: 5515 Views
  • UncleCheese
    Avatar
    4085 Posts

    SWFUpload Documentation Link to this post

    I've posted the documentation for SWFUploadField here: http://doc.silverstripe.com/doku.php?id=swfuploadfield

  • schellmax
    Avatar
    Community Member
    126 Posts

    Re: SWFUpload Documentation Link to this post

    i was just wondering wheter it's possible to use SWFUploadFileIFrameField in a popup in the cms.
    this to avoid the common 'You can add images once you have saved for the first time.' hassle of Imagefield.
    unfortunately, it doesn't seem to work (using swfuploadfileiframefield in getCMSFields_forPopup gives errors).
    is this supposed to work so i am doing something wrong?
    or maybe there's a more clever way to circumvent the 'upload after first save' issue?
    thanks in advance

  • UncleCheese
    Avatar
    4085 Posts

    Re: SWFUpload Documentation Link to this post

    Hello,

    Thanks for your interest in the SWFUpload module. The SWFUploadFileIFrame field is useful for filtering out unwanted file types and sizes and displaying a progress bar for large files, but one thing it cannot do is overcome the (annoying) issue of having to save a new record before adding a file. The reason is because your file object needs an "ownerID" to make the correct association with your DataObject class. Until the record is saved, that ID of course, does not exist.

    If you're looking for a better way of handling this issue, I'd recommend using the DataObjectManager. Though it doesn't have a "fix" for the problem, it is handled in a much cleaner way with clear language to the user. For instance, if your DataObject has a File relation called "Image", the save button on a new record will read "Save and add Image" -- as opposed to a standard CTF, which will advance the user to a new record without any indication that a file has not been added.

    Try it out!

  • Judge
    Avatar
    Community Member
    79 Posts

    Re: SWFUpload Documentation Link to this post

    I know this is an old post, but is the "owner ID" statement still relevant? I thought it was the owner that points at the File or Image record rather than the File or Image that points at the owner. A file can be uploaded onto the system without linking it to any other objects.

    It ought to be possible to upload the files first, and getting their unique IDs. Once the main record is saved, it can be linked to the files. The files could even be uploaded to a special object that labels them as temporary, and they can be cleaned up by some house-keeping if they are not linked to some object within a given time-frame.

    -- Jason

  • Judge
    Avatar
    Community Member
    79 Posts

    Re: SWFUpload Documentation Link to this post

    I guess the documentation has been moved, but all links seem to point back to this same dead page.

    -- Jason

  • UncleCheese
    Avatar
    4085 Posts

    Re: SWFUpload Documentation Link to this post

    This is the correct link:

    http://doc.silverstripe.org/doku.php?id=modules:swfuploadfield

    What you're describing is the way SWFUploadField works. SWFUploadFileIFrameField has been deprecated.

  • sparkalow
    Avatar
    Community Member
    8 Posts

    Re: SWFUpload Documentation Link to this post

    Not sure where to submit bugs/fixes, so UncleCheese direct me if needed.

    Portability issue with SWFUploadFileIframeField:

    The RelativeLink method returns a url that is not entirely portable and was causing uploads to fail with a 404 on a site we have installed in a subfolder.

    The fix was to replace

    public function RelativeLink($action = null)
       {
          if($action === null) $action = "index";
          return "/swfuploadfile/$action/".$this->urlParams['Class']."/".$this->urlParams['ID']."/".$this->urlParams['Field'];
       }

    with

    public function RelativeLink($action = null)
       {
          if($action === null) $action = "index";
          return "swfuploadfile/$action/".$this->urlParams['Class']."/".$this->urlParams['ID']."/".$this->urlParams['Field'];
       }

    removed the "/" from the beginning of the return.

  • ryeze
    Avatar
    Community Member
    6 Posts

    Re: SWFUpload Documentation Link to this post

    I am very interested in this SWFUpload module. I'm building a website, I have some problems with file uploads. could you please give me a code for the example application using this module. existing code in http://doc.silverstripe.org/old/modules:swfuploadfield not help me. thanks.

    5515 Views
Page: 1 2
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.