7912 Posts in 1355 Topics by 930 members
|Go to End|
24 June 2009 at 4:25am
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?
24 June 2009 at 7:20am
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:
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.
24 June 2009 at 7:37am
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?
24 June 2009 at 7:56am
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'
24 June 2009 at 11:18am
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?
|Go to Top|