如何将文件对象设置为HTML格式的输入文件? [英] How to set file object into input file in the form in HTML?

查看:84
本文介绍了如何将文件对象设置为HTML格式的输入文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将我上传的文件对象设置为另一个文件对象

I want to set file object which i had uploaded into another

<input type='file' name="file" id="fileid" />

我也尝试过使用

$("#fileid").attr("files",fileObject);

但它不起作用。有没有其他解决方案将文件对象设置为表单输入字段?

but it doesn't work. Is there any other solution to set file object into form input field??

推荐答案

这是可能的,因为我已经使用angularJS 。
以前的文件内容在特定情况下很少发布空白,现在它不会发送使用angularjs和更新的FORMDATA()注入的空白数据。

It's possible as i had fixed this issue using angularJS. Earlier file content are posted blank rarely with particular situation, Now it will not send blank data which are injected with angularjs and updated FORMDATA().

这篇关于如何将文件对象设置为HTML格式的输入文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆