Jump to:

7938 Posts in 1541 Topics by 945 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » SWFUpload implimentation

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: 1905 Views
  • micahsheets
    Avatar
    Community Member
    164 Posts

    SWFUpload implimentation Link to this post

    I have a model admin interface that manages a DataObject that has Images associated with it. I want to be able to upload images with the swfupload but I also don't need any information stored with the images. No caption, title or anything other than the uploaded date. From looking at the ImageGalleryManager.php file I can see that it is more complex than a simple ImageField. I need to know what things are required to make this work. I see SWFUploadConfig::addPostParam() and SWFUploadField() and handleswfupload(). Are these all that is needed and if so is there any documentation on them anywhere?

    Thanks.

  • UncleCheese
    Avatar
    4085 Posts

    Re: SWFUpload implimentation Link to this post

    SWFUploadField isn't quite to the point yet that it can magically manage file relationships to a DataObject. You might want to reference this post:

    http://www.silverstripe.org/dataobjectmanager-module-forum/show/261187#post261187

    Describing how to build a simple resume upload form using SWFUploadField. To do what you're doing you will have to create your own handleswfupload() function in the controller. Totally possible, and quite easy (for me, anyway) to do.

  • micahsheets
    Avatar
    Community Member
    164 Posts

    Re: SWFUpload implimentation Link to this post

    I tried something similar, but I used SWFUploadFileIFrameField in my model admin. I see the iFrame but it has a login screen telling me that I don't have permission to access that page. The member I am testing with is not an ADMIN but I still need this to work.

    Does SWFUploadFileIFrameField still only work with one file at a time?

    Since I am using ModelAdmin and loading images for a specific DataObject, not a page, where do I put the handleswfupload()? Do I make a controller for my ModelAdmin or the DataObject?

  • UncleCheese
    Avatar
    4085 Posts

    Re: SWFUpload implimentation Link to this post

    By default it will use the current controller. Not sure what that is in model admin. You can set a custom url in your config array.

    'upload_url' => '/SomeController/handleswfupload'

  • micahsheets
    Avatar
    Community Member
    164 Posts

    Re: SWFUpload implimentation Link to this post

    What is the exact syntax for 'upload_url' => '?

    if I have a controller on a DataObject say "class Student_Controller extends Controller" then is the sytnax:

    'upload_url' => '/Student_Controller/handleswfupload' ?

    I noticed that in ImageGalleryManager you use Director::absoluteURL() when setting the upload_url, what does that do?

    Also why is it that I can only use SWFUploadFileIFrameField in the CMS? That one only allows 1 upload at a time. Is there a way to allow using SWFUploadField in the CMS?

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