0

I have the following code giving a manual browse file dialogue:

input type="file" name="image_file" id="image_file" onchange="fileSelectHandler()"

Is there a way to call this (perhaps using javascript?) automatically on page enter so that the user is given the browse file dialogue upon entering the webpage?

Thanks!

user2912230
  • 79
  • 3
  • 12
  • code please...? any way...http://stackoverflow.com/questions/3842614/how-do-i-call-a-javascript-function-on-page-load might help – Srinath Mandava Jun 07 '14 at 19:31

1 Answers1

0
<input type="file" name="image_file" id="image_file" onchange="fileSelectHandler()" style="visibility:hidden" />

and the jquery code:

<script>
$(document).ready(function(){
$("input[type='file']").trigger('click');
});
</script>

This requires permissions from user to allow pop ups for security reasons... Jquery trigger file input http://www.acunetix.com/websitesecurity/upload-forms-threat/

Community
  • 1
  • 1
Srinath Mandava
  • 3,384
  • 2
  • 24
  • 37