15

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.

surfmuggle
  • 5,527
  • 7
  • 48
  • 77
Matteh
  • 151
  • 1
  • 4
  • i just got the same problem and found out that the error occurs whenever i try to include swfobject.js. even without any other code and just the swfobject.js included in the header, the error comes up, only in chrome. – andyrandy Nov 14 '12 at 11:16
  • For anyone who may be wondering, I never found a solution to this, and for the project it was being used on, we moved away from using Uploadify, so unfortunately I can't offer any more useful information. – Matteh Jan 11 '13 at 11:17
  • seems browsers flash player problem. can u try upgrading this. – bijayk Jan 22 '13 at 07:35

3 Answers3

1

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?).

Community
  • 1
  • 1
benbai123
  • 1,423
  • 1
  • 11
  • 11
1

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?

Pabamato
  • 171
  • 5
1

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 )

Adrian Romero
  • 537
  • 6
  • 13