有什么方法能ajax上传文件呢 ?
<form enctype="multipart/form-data" method="post" action="http://A.com/upload.php">
<input type="file" name="file">
<input type="submit">
</form>
正常是这样的吧 , 然后会返回 http://A.com/upload.php , json 数据
怎么实现 在同一页面 ajax 上传呢 ?
jquery post 文件上传 JavaScript angularjs
六氯环己烷
10 years, 2 months ago
Answers
可以配合jquery.form 来做 或者用这个 https://github.com/blueimp/jQuery-File-Upload
方得不得了
answered 10 years, 2 months ago
用动态插入iframe,参考 http://www.ruanyifeng.com/blog/2012/08/file_upload.html
noir87
answered 10 years, 2 months ago