diff --git a/js/jquery.iframe-transport.js b/js/jquery.iframe-transport.js index 8d64b591b..2874e6cc5 100644 --- a/js/jquery.iframe-transport.js +++ b/js/jquery.iframe-transport.js @@ -119,6 +119,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') {