0

This code works on Firefox, but does not work on Mac/iOS Safari. Is there a way to make it work?

$(function(){ 
setTimeout(function(){ $("input[name='upload']").trigger('click'); },1000);
});
1
  • For best results I suggest you add jQuery and safari tags, and remove the iOS tag. Commented Jan 26, 2019 at 0:16

2 Answers 2

1

not sure if this will work, but maybe you can try.

Add this meta tag at the top

<meta name="apple-mobile-web-app-capable" content="yes">

And for the input field maybe try

<input accept="image/png,image/gif,image/jpeg" type="file" name="upload" />

Hope this helps!

Sign up to request clarification or add additional context in comments.

Comments

1

Apparently that's prohibited. probably in terms of security. https://mariusschulz.com/blog/programmatically-opening-a-file-dialog-with-javascript

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.