JavaScript / jQuery + HTML5文件上传[.zip / .txt]并将此文件作为jSon Data发送 [英] JavaScript/jQuery + HTML5 file upload[.zip/.txt] And Send this file as jSon Data
问题描述
如果您有[任何服务器端脚本] [1]技术,那么问题就相当简单了,但是在处理[即。将文件原样发送到jSON函数。
场景是:
1。我有一个文件上传控件
The question is rather simple if you have [Any server side scripting][1] techniques, but in the case of handling[viz. sending] the file as-is to the jSON function.
The scenario is :
1. I have a fileupload control
<input type="file" id="fileselect" name="fileselect[]" multiple="multiple" />
2.在javascript或jQuery的帮助下,我需要上传此控件的上传文件点击上传按钮。
我需要将此文件发布到jSON。
3.为什么需要按原样发布是因为文件可以是.zip或.text [图片文件不会被使用],我的功能在我的将在该文件上工作的控制器[如提取/保存/处理等]
任何适用于所有浏览器的好方法都可以这样做吗?
也在下面
[1]:http://www.w3.org/TR/WCAG20-TECHS/ server-side-script.html
2. with the help of javascript or jQuery, I need to take the uploaded file of this control on "upload" button click.
I need to POST this file to the jSON.
3. Why need to post it as-is is because the file can be .zip or .text [Image file wont be used], I have functions in my Controllers that will work on that file[like Extract/Save/Process, etc]
Any good way that works on all browsers to do this ?
Also in below
[1]: http://www.w3.org/TR/WCAG20-TECHS/server-side-script.html
推荐答案
这篇关于JavaScript / jQuery + HTML5文件上传[.zip / .txt]并将此文件作为jSon Data发送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!