+ 5
Image uploading using only single upload button
i wanna upload an image on web page without using choose file option rather only upload button should appear which will be doing both the things first selects file and once file is selected then submits it. I tried it using only one input field type text and tried to get its value using "onchange" event on this input field but on printing filename in JavaScript i got filename as "C\fakepath\filename.ext" (as file was in C drive). Can anyone tell how can i upload img using single button wid jquery nd other
1 ответ
+ 1
Simply try to create input type file and once you choose the file call ajax function for upload file by the event on change handled on input file