Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uploadify "Uncaught Call to StartUpload failed" when used in Facebook Canvas app on Chrome and IE

I have implemented the standard Flash version of the Uploadify jQuery plugin within a canvas app on Facebook.

The upload is working perfectly fine in Firefox. But when I try to start an upload in Chrome or IE, it fails with this message in the console:

Uncaught Call to StartUpload failed

For those not familiar with Facebook canvas apps, it's PHP pages running within an iframe in Facebook which might be leading to this problem - though it doesn't work when run outside of a frame either.


I'm also getting these errors in the Chrome console:

Unsafe JavaScript attempt to access frame with URL https://apps.facebook.com/[app name]/[page name]/ from frame with URL https://[app domain]/[page path]. The frame being accessed set 'document.domain' to 'facebook.com', but the frame requesting access did not. Both must set 'document.domain' to the same value to allow access.


Any ideas what might be happening? I've already tried setting up a crossdomain.xml for Flash with no success.

like image 247
Matteh Avatar asked Oct 26 '12 10:10

Matteh


3 Answers

According to another thread Changing document.domain to completely other domain, it is possible that change domain to the suffix of current domain.

If the "[app domain]" can be changed, you can try change [app domain] to "https://[app domain].apps.facebook.com/" and run the javascript from iframe page when iframe is loaded

document.domain = 'facebook.com';

But not sure whether there are any issues of adding another domain as suffix (is it legal?).

like image 147
benbai123 Avatar answered Nov 20 '22 00:11

benbai123


I had an issue a long time ago with facebook and crossdomain, did you try

header('P3P: CP="CAO PSA OUR"');

on your php file?

like image 32
Pabamato Avatar answered Nov 20 '22 01:11

Pabamato


1.-try edit your urls in your api settings, as name_api_to_download.domain.com or domain.com, and use only ssl subdomain or domain true

2.-use ajax request(post or get) preferer to download files and not iframes, because you use parent iframe api, and it not is accesible

3.-use in name_api_to_download a header valid(as a MIME type is application/pdf )

like image 1
Adrian Romero Avatar answered Nov 20 '22 02:11

Adrian Romero