Retrieving the full path (server-side) of a file uploaded using Firefox?

后端 未结 3 1884
无人及你
无人及你 2020-12-11 20:59

When I am using a form containing to upload a file, my server-side code only sees the filename with

3条回答
  •  Happy的楠姐
    2020-12-11 21:41

    I already stated this in a comment, but I think it bears repeating.

    Microsoft opted to make the file control give the entire path to the file for use in intranet applications.

    The HTML specification only makes mention of what the value should contain in one spot:

    User agents may use the value of the value attribute as the initial file name.

    However, they also have examples of what the multipart/form-data encoding should look like, and it doesn't contain the file path.

    In other words, IE is breaking the standard and you can't rely on other browsers, even later versions of IE, to support it.

提交回复
热议问题