File upload without user interaction
-
How to upload a file without user interaction, if I know the exact file path. I don't want to click Browse button for every file I wan't to upload. :confused:
I have not tried this but you could try and use JavaScript to set the FILE input element to the exact path and filename you want to upload. Then use JavaScript again to submit the form. You do still need the form and you still do need the FILE input.
Paul Watson
Bluegrass
Cape Town, South Africabrianwelsch wrote: I find my day goes by more smoothly if I never question other peoples fantasies. My own disturb me enough.
-
I have not tried this but you could try and use JavaScript to set the FILE input element to the exact path and filename you want to upload. Then use JavaScript again to submit the form. You do still need the form and you still do need the FILE input.
Paul Watson
Bluegrass
Cape Town, South Africabrianwelsch wrote: I find my day goes by more smoothly if I never question other peoples fantasies. My own disturb me enough.
I would suspect that doesn't work - just think of the security implications if any site you visit can upload any file from your machine to their server. :eek:
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
I would suspect that doesn't work - just think of the security implications if any site you visit can upload any file from your machine to their server. :eek:
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Richard Deeming wrote: I would suspect that doesn't work - just think of the security implications if any site you visit can upload any file from your machine to their server I know, but I have the best hopes for the intentions of the poster :) You are right though, just been fiddling and the simple way does not work. However I suspect that if you focus the FILE input and then simulate keypresses you can make it work. Anyone know how to simulate keypresses using JavaScript?
Paul Watson
Bluegrass
Cape Town, South Africabrianwelsch wrote: I find my day goes by more smoothly if I never question other peoples fantasies. My own disturb me enough.
-
I have not tried this but you could try and use JavaScript to set the FILE input element to the exact path and filename you want to upload. Then use JavaScript again to submit the form. You do still need the form and you still do need the FILE input.
Paul Watson
Bluegrass
Cape Town, South Africabrianwelsch wrote: I find my day goes by more smoothly if I never question other peoples fantasies. My own disturb me enough.