javascript - How does FormData() knows the path in OS of the file that is submitted in the form? -


here dump of file object passed formdata(). there no path info. file on desktop, not in project folder javascript running.

> name: "i5cy82h6u7rol1]@)9d]9)g.jpg" size: 39424 type: "image/jpeg" > webkitrelativepath: "" > __proto__: file

i using following code submit form. how program know path of file sending in form? same confuse me when using filereader instead of form os file user submitted. there file name in file object.

my question path info?

var formdata = new formdata();  formdata.append("username", "groucho"); formdata.append("accountnum", 123456); // number 123456 converted string "123456"  // html file input user's choice... formdata.append("userfile", fileinputelement.files[0]); 

the fileinputelement.files[0] represent input of input type="file" element.

the browser intermediate between actual file , server / client. reads bytes disk , passes steam.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -