Skip to content
This repository was archived by the owner on May 25, 2023. It is now read-only.

Safari v11+ not working with blueimp/jQuery-File-Upload plugin with jQuery 1.7 #3538

Closed
afenix opened this issue Nov 19, 2019 · 5 comments
Closed

Comments

@afenix
Copy link

afenix commented Nov 19, 2019

I am stumped at the moment as to why I am unable to get the blueimp/jQuery-file-upload plugin to work with the desktop Safari browser v11+. My QA tested with v11.2 (MacOS El Capitan) and I've tested on v13.0.3 (macOS Mojave 10.14.6). Safari doesn't appear to be calling the .fileupload() function. However, the plugin works as expected in both Chrome and Firefox.

Here's the bare bones code I've been using for testing.

Html

<input class="upload" type="file" name="FileData" id="fileupload-remove-items" data-url="/analysis/upload"/>

JS:

  $('#fileupload-remove-items').fileupload({
        dataType: 'json',
        start: function (e, data){
            console.log('start'); // fires in Chrome & Firefox browsers, but *not* Safari
        },
        progress: function (e, data){
            console.log('progress');  // fires in Chrome & Firefox browsers, but *not* Safari
        },
        done: function (e, data) {
            console.log('done'); 
        }
    }); 

In both Firefox & Chrome the console.log() fires as expected. But nothing happens at all in Safari. I haven't been able to find any related SO posts or bug reports in this repo that answer this question so I'm now reaching out here. Can anyone else replicate this issue? Interestingly, I am able to upload a file from the demo page using Safari but looking through the demo code thus far has not made it clear how/why the simple above use case consistently fails with Safari.

Any help would be most welcome. Thanks ahead of time!

I have also asked this question on S.O.: https://stackoverflow.com/questions/58896103/safari-v11-not-working-with-blueimp-jquery-file-upload-plugin

@afenix
Copy link
Author

afenix commented Nov 20, 2019

Howdy! I figured it out finally... it was the version of jQuery that my legacy website is using - namely, 1.7.3 which does not work with newer versions of Safari. When I upped my jQuery to 1.8 Safari finally stepped in line like the other browsers. I'd love to know what is specifically breaking it from that version, but need to move on and get this feature set out the door. Hopefully this is useful info for you and others. My answer is also on S.O.: https://stackoverflow.com/questions/58896103/safari-v11-not-working-with-blueimp-jquery-file-upload-plugin/58961924#58961924

@blueimp
Copy link
Owner

blueimp commented Nov 24, 2019

Thanks a lot for coming back and posting your solution @afenix !

I've labeled this as a combined jQuery/browser bug and will leave the issue open for others to find your solution.

As far as I know, it's safe to upgrade to jQuery 1.9, which is the last version which supports IE 6-9.
I'll leave the minimal dependency version as jQuery 1.6 as it's still true for the project, despite the issues with Safari.

@RobAndersson
Copy link

This was the same as my issue #3536.

I narrowed it down to being the change from jQuery 1.7.x -> 1.8.0; where the lower version didn't play well with newer Safari.

@blueimp blueimp changed the title Safari v11+ not working with blueimp/jQuery-File-Upload plugin Safari v11+ not working with blueimp/jQuery-File-Upload plugin with jQuery 1.7 Feb 17, 2020
@blueimp
Copy link
Owner

blueimp commented Feb 17, 2020

I've removed the browser/jquery bug labels, since #3536 points to this issue being fixable in this library (thanks @RobAndersson).

@blueimp
Copy link
Owner

blueimp commented May 15, 2020

Turns out this was a regression introduced in #3435, which replaced promise.pipe() with promise.then().

When reviewing this I didn't test with jQuery versions lower than 1.8 anymore and unfortunately the behavior of promise.then() only matched that of promise.pipe() from jQuery 1.8 and higher.

But it should finally be fixed now for old (< 1.8) jQuery versions with the latest release:
blueimp-file-upload@10.27.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants