Jquery Ajax Cross-domain File Upload
Posted : admin On 08.02.20205.16.2 Cross-Origin Resource Sharing (CORS)or Cross-origin resource sharing allows client-side JavaScript to make AJAX requests to another domain.Fine Uploader has support for uploading and sending requests via CORS, but there are a fewcaveats depending on which browser is being used. Support exceptions. In IE8 and IE9, the response from the request iframe is passed to the uploader window via window.postMessage. Delete file CORS requests in IE9 and earlier are not supported.
Jquery Ajax Cross-domain File Uploads
$( '#fileupload '). Fileupload('option ','redirect ',');The plugin will transmit the absolute URL set as redirect option as part of the formData (with the parameter name redirect if the option redirectParamName is not set as well) if the file upload is a cross-domain iframe transport upload.
Else (for XHR file uploads or same-domain iframe uploads), the option is ignored.On server-side, you need to check if a request parameter redirect has been transmitted with the file upload. In this case, the server response to the upload has to be a redirect to this parameter, with the urlencoded result contents appended to the redirect URL.Note that the redirect URL is supposed to have a placeholder (e.g.%s) as part of the URL, where the upload server will append the urlencoded upload results.The page adds the decoded result content as body content. This allows the plugin to access the response without cross-domain access issues.Note:The response should not exceed a certain length, as the redirect URL is limited by the maximum URL length(What is the maximum length of a URL?) that browsers will process.Cross-site iframe transport uploads to different subdomainsIf both servers - the server hosting the upload form and the target server for the file uploads - are just on different subdomains (e.g.