When creating a FormData object from an existing form, are filenames automatically appended and accessible?

自古美人都是妖i 提交于 2019-12-02 03:49:27
user1063287

It seems the filename is automatically added (just tested in Chrome and not sure if this differs in other circumstances).

Steps To Reproduce

  • Go to http://jsfiddle.net/rwone/vsRSf/
  • Open Network tab in Developer Tools
  • Select two images and click the button
  • View the Network tab and you will see the filenames are defined

The image information is only defined with two parameters, and not the third filename parameter:

myFormData.append(name, file);

Original fiddle based on this post:

https://stackoverflow.com/a/21901886/1063287

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!