开发者

Is it possible to add or modify multipart/form-data headers to emulate a <input type="file"> element?

Specifically I'd like to be able to set the Content-Disposition and Content-Type headers for a specific input field to look like a type="file" input field, e.x.

Content-Disposition: form-data; name="myformfile"; filename="myfile.jpeg" Content-Type: image/jpeg

I w开发者_如何转开发ant to do this on an existing HTML form, not by manually formatting an XMLHttpRequest body.

(The use case is in a browser extension / userscript, to replace a file upload button with one the extension can programmatically set)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜