Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, Ed, biapar, Willr, Ingo, swaiba

Issue with Uploadify


Go to End


4 Posts   1652 Views

Avatar
Arctos

Community Member, 3 Posts

7 April 2011 at 2:26pm

After scouring the forums, both the Silverstripe and Uploadify; I wasn't sure which to specifically diagnose.

Using the latest Silverstripe (2.4.5), latest DataObjectManager and Uploadify (since 4/1/2011):

In attempts to upload anything, I end up with a white page, except for "Closing..."

With the following notable firefox error console errors:

Error: parent.jQuery is not a function
Source File: http://www.bengaltownship.org/beta/admin/assets/EditForm/field/Files/UploadifyForm?SecurityID=cd93d5a4242f540f89d1908a2a91a8fb4a2ed195&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]=
Line: 24

Warning: Form contains a file input, but is missing method=POST and enctype=multipart/form-data on the form.  The file will not be sent.
Source File: http://www.clientwebsite.org/beta/admin/assets/EditForm/field/File/upload?SecurityID=cd93d5a4242f540f89d1908a2a91a8fb4a2ed195 Line: 0

Interestingly enough, it seems to have uploaded the files... despite the nearly-White-Screen-Of-Death. My local WAMP version, wasn't able to get that far. I've worked with DataObjectManager and Uploadify with success in the past, so as far as I know it isn't blatant user error.

Thoughts?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

8 April 2011 at 6:54am

Yeah, it looks like the Form class is hardcoded to look for FileField subclasses. That's a drag. No way to override it, either.

function FormEncType() {
if(is_array($this->fields->dataFields())){
foreach($this->fields->dataFields() as $field) {
if(is_a($field, "FileField")) return "multipart/form-data";
}
}
return "application/x-www-form-urlencoded";
}

Avatar
Arctos

Community Member, 3 Posts

8 April 2011 at 9:46am

I appreciate the reply,

..but where specifically are you pulling this snippet from? Silverstripe Core? Uploadify? DataObjectManager? ... and the fact that there "no way to override it", no band-aids? Because in working with different site, this time utilizing your Image_Gallery.

Same error, I feel like I must be missing something.

Thanks,

Avatar
UncleCheese

Forum Moderator, 4102 Posts

8 April 2011 at 1:28pm

That's in Form.php.

It's not really an error, it's just a warning. Ideally you want the multipart enctype on a form with a file input, but it's kind of a moot point since Flash replaces the file input with its own interface.