diff --git a/vendor/assets/javascripts/jquery-fileupload/jquery.iframe-transport.js b/vendor/assets/javascripts/jquery-fileupload/jquery.iframe-transport.js index e04e7a0..5734fae 100755 --- a/vendor/assets/javascripts/jquery-fileupload/jquery.iframe-transport.js +++ b/vendor/assets/javascripts/jquery-fileupload/jquery.iframe-transport.js @@ -115,6 +115,13 @@ .val(field.value) .appendTo(form); }); + // Add a hidden `X-Requested-With` field with the value `IFrame` to the + // form, to help server-side code to determine that the upload happened + // through this transport. + $('') + .prop('name', 'X-Requested-With') + .val('IFrame') + .appendTo(form); } if (options.fileInput && options.fileInput.length && options.type === 'POST') {