I am trying to upload a file using the following script
<form name="multiform" id="multiform" method="post" enctype="multipart/form-data" >
<input type="file" size="60" accept="text/plain" id="myfileId" name="myfile"/><br/><br/>
<input type="button" value="Upload File" onclick="submitForm();" /></form>
</body></html>
I have noticed that file attribute is having file name along with full path.
POST /xxx/yyy?uploaddata=1 HTTP/1.1
Host: abc.def.com
:
:
Content-Type: multipart/form-data; boundary=---------------------------22966874711757
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
-----------------------------22966874711757
Content-Disposition: form-data; name="myfile"; filename="**C:\my\file\path\TestFile.txt**"
Content-Type: text/plain
-- ………
I have tried
- I have tried it by disabling "Include local directory path when uploading files to a server” But it does not work with multipart
- I have gone through "https://stackoverflow.com/a/20537822/588079" but I am sure how to use this in my HTML form
How to resolve this problem so that file upload works for any kind of browser?