Skip to content

Commit c0724d6

Browse files
Jason Goldsteinwhatisjasongoldstein
authored andcommitted
Fix uploads in Chrome
Patches jquery.form per advice on this issue: jquery-form/form#571 Ajax doesn't support posting files, so before FormData, the only way to upload a file without a page refresh was to create an iframe, build a form in it, and submit that to the server in a way where it could sync up with the data POSTed by ajax. Chrome 83 has an issue with the fake src jquery.form was setting on that iframe, and would cancel the request. With no image uploaded to the server (but no error in js to treat as a blocking error) the process would attempt to continue and hit an error when it tries to access a file that doesn't exist. FUN-2604
1 parent b89cfeb commit c0724d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cropduster/static/cropduster/js/jquery.form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ $.fn.ajaxSubmit = function(options) {
8888
url: url,
8989
success: $.ajaxSettings.success,
9090
type: this[0].getAttribute('method') || 'GET', // IE7 massage (see issue 57)
91-
iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'
91+
iframeSrc: 'about:blank'
9292
}, options);
9393

9494
// hook for manipulating the form data before it is extracted;

0 commit comments

Comments
 (0)