I've posted the documentation for SWFUploadField here: http://doc.silverstripe.com/doku.php?id=swfuploadfield
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
- Page 11(current)
- 2
- Next 10 entries
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
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!
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
I guess the documentation has been moved, but all links seem to point back to this same dead page.
-- Jason
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.
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.
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.
- Page 11(current)
- 2
- Next 10 entries