如何使用javascript / jquery将.doc / .docx文件发送到webservice方法? [英] How to Send a .doc / .docx file to webservice method using javascript/jquery?
问题描述
我需要做一个如下所示的示例页面,
名称:文本框
DOB:文本框
。
。
。
上传文件:选择文件(.doc,.docx)
保存(按钮)
现在保存时,它应该将数据发送到webservice,如name,dob ,上传的文件(与上传的结构相同)。从webservice我需要将它保存到DB。我在javascript中使用过File reader。但它只读取txt,或图像文件而不是.doc,.docx文件。有没有人可以帮我这个?
---提前谢谢 -
浏览器不会对它自己做任何事情并且你必须为它编码,至少是javascript ajax调用。
http:// blog .teamtreehouse.com / uploaded-files-ajax [ ^
Hi,
I need to do a sample page like below,
Name: textbox
DOB : textbox
.
.
.
Upload File : Choose File (.doc,.docx)
Save(button)
Now When Save, it should send data to webservice like name,dob,uploaded file (with same structure as uploaded). From webservice i need to save it to DB. I have used File reader in javascript. But it reads only txt, or image file not .doc,.docx files. Could any one help me on this?
---Thanks in advance--
A browser does not do anything on it's own and you have to code for it, the least is javascript ajax call.
http://blog.teamtreehouse.com/uploading-files-ajax[^]
这篇关于如何使用javascript / jquery将.doc / .docx文件发送到webservice方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!