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

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

DOM and Uploadify image not attaching


Go to End


25 Posts   12444 Views

Avatar
aarono

Community Member, 34 Posts

21 February 2011 at 5:29pm

Edited: 21/02/2011 5:33pm

Hi guys

I have got SS 2.4.5 and the latest build of DOM and Uploadify as at 21st Feb.

Whenever I try to upload a new image into the DataObject using Uploadify, it gets to 100% but then doesn't refresh and attach the "Attached files". However it does actually upload the image and transfer it into the correct folder, as well as adding it to the File table in the database with the correct ClassName, but not into my DataObject table.

If I copy the request URL into the browser (EditForm/field/MediaItems/UploadifyForm/field/UploadedFiles/refresh?ctf[MediaItems][start]=0&ctf[MediaItems][per_page]=10&ctf[MediaItems][showall]=0&ctf[MediaItems][sort]=SortOrder&ctf[MediaItems][sort_dir]=&ctf[MediaItems][search]=&ctf[MediaItems][filter]=&ctf[MediaItems][view]=grid&ctf[MediaItems][imagesize]=100&FileIDs=131) then i just get a blank page, even though the FileID 131 does exist in the database. I cant seem to find the correct refresh function to be able to start debugging. I found one inside FileUploadField.php in the Uploadify module, but it wont send any info the browser?

Can anyone point me in the right direction? I need to get this sorted ASAP as client needs website to be live, so any help would be greatly appreciated

UPDATE: ok so i have just tried to upload a much smaller image, and it worked fine. The smaller file is 30kb as apposed to 400kb, but 400kb is still quite small, so I'm guess there is a very low timeout setting somewhere? I have checked my upload limit and its 24M so its not that.

Cheers,
Aaron

Avatar
aarono

Community Member, 34 Posts

22 February 2011 at 1:26pm

Anyone? Need this to go live tomorrow

Avatar
UncleCheese

Forum Moderator, 4102 Posts

23 February 2011 at 12:13pm

Can you check the response from the server? If the upload is completing, you should see an ajax request that is supposed to return the ID of the new file. It may be returning a server error.

Otherwise, use Charles to packet sniff the request, and you should see some sort of error coming back, provided you have your error reporting cranked up.

Avatar
aarono

Community Member, 34 Posts

23 February 2011 at 12:38pm

Hi UncleCheese,

Thats what confuses me the most - it doesn't throw any errors at all. The upload returns a 200 complete response and the refresh does as well. The upload request also returns the new file ID

Im viewing the requests in Charles

Thanks for your help with this

Avatar
UncleCheese

Forum Moderator, 4102 Posts

23 February 2011 at 2:45pm

It's not making a whole lot of sense to me. Everything is coming back 200. Do you have the content of the response for the /refresh/ request?

Avatar
aarono

Community Member, 34 Posts

23 February 2011 at 2:51pm

No it doesn't make any sense to me either. This is the raw response from the refresh request:

HTTP/1.1 200 OK
Date: Wed, 23 Feb 2011 01:49:48 GMT
Server: Apache/1.3.41 (Unix) FrontPage/5.0.2.2635 mod_ssl/2.8.31 OpenSSL/0.9.8g PHP/5.2.17 with Suhosin-Patch
X-Powered-By: PHP/5.2.17
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: PastMember=1; expires=Tue, 24-May-2011 01:49:49 GMT; path=/new/; httponly
Transfer-Encoding: chunked
Content-Type: text/html

This is the responses from the upload request, for what its worth:

HTTP/1.1 200 OK
Date: Wed, 23 Feb 2011 01:49:35 GMT
Server: Apache/1.3.41 (Unix) FrontPage/5.0.2.2635 mod_ssl/2.8.31 OpenSSL/0.9.8g PHP/5.2.17 with Suhosin-Patch
X-Powered-By: PHP/5.2.17
Set-Cookie: PHPSESSID=aecdspi9tclkm0b2rpm5p0bi56; path=/new/; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: PastMember=1; expires=Tue, 24-May-2011 01:49:45 GMT; path=/new/; httponly
Transfer-Encoding: chunked
Content-Type: text/html; charset="utf-8"

186

Avatar
UncleCheese

Forum Moderator, 4102 Posts

24 February 2011 at 6:04am

Ah, I just remembered. I've seen this problem before. Try adding:

ContentNegotiator::disable();

to your _config.php.

Go to Top