Wednesday 26 October 2011

HTML FORM - changing of file default value?

here is the code.

%26lt;form action=%26quot;myupload.php%26quot; method=post enctype=%26quot;multipart/form-data%26quot;%26gt;

submit this file: %26lt;input type=file name=%26quot;userfile%26quot; size=%26quot;20%26quot;%26gt;

%26lt;input type=submit%26gt;

%26lt;/form%26gt;



%26lt;input type=submit%26gt;

%26lt;/form%26gt;



now can i change the value of %26lt;input type=file name=%26quot;userfile%26quot; size=%26quot;20%26quot;%26gt; i tried to upload a file c:\mypic.jpg without clicking on browse button. i also tried like this http://domain.com/myupload.php?userfile=c:\mypic.jpg but its not working.. any solution??????
HTML FORM - changing of file default value?
The code: submit this file: %26lt;input type=file name=%26quot;userfile%26quot; size=%26quot;20%26gt; relies on the user to click the 'browse' buttont o browse for the file on the local harddrive to upload.



What exactly is it that you are trying to accomplish? Are you 1) trying to upload the file from your local harddrive or 2) trying to upload a file from a remote location (like a web site or something different?



To upload %26quot;c:\mypic.jpg%26quot; you **NEED** to click the browser button to upload.



On %26quot;myupload.php%26quot; how are you handeling the file that is being uploded? Are you 1) saving it on the web server in a folder (ideally IMAGE folder if its an image) or saving it to the dB?
  • drawing a circle
  • one web hosting
  •