Programmatically set name of file to upload in webpage

前端 未结 4 1119
执笔经年
执笔经年 2021-01-15 15:21

Is there a way to programmatically set the name of a file to be uploaded from a web page? I suspect that browser security restrictions make this impossible, but I\'m hoping

4条回答
  •  我在风中等你
    2021-01-15 16:17

    Yes you can (in modern browsers)...

    You can get and set the value of HTMLInputElement.files. See this answer.

提交回复
热议问题