You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 8, 2026. It is now read-only.
lookfwd edited this page Sep 5, 2011
·
21 revisions
jQuery-File-Upload allows cross domain requests. We can modify the example to demonstrate this feature.
To allow cross domain uploads modify example/upload.php near the top:
'script_url' => "http://".$_SERVER['PHP_SELF'],
'upload_url' => "http:///".dirname($_SERVER['PHP_SELF']).'/files/',
and a few lines later:
'thumbnail' => array(
'upload_url' => "http:///".dirname($_SERVER['PHP_SELF']).'/thumbnails/',
also add:
case 'OPTIONS':
break;
on the supported request methods at the end of upload.php.
You also need to add Header set Access-Control-Allow-Origin * (or whatever the domain you host your jQuery Ajax Uploader is). For apache server check this page shows how: http://enable-cors.org/#how-apache. You will also find how to do it for PHP and other servers on the same page.
Don't forget to ensure that you have GD enabled and suitable directory permissions on the files and thumbnails directories.
Tested with Firefox 6.0.1, Chrome 13.0 and IE6 (it uploads successfully but gives some Javascript error – known limitation)