如何使用javascript / jquery将.doc / .docx文件发送到webservice方法? [英] How to Send a .doc / .docx file to webservice method using javascript/jquery?

查看:78
本文介绍了如何使用javascript / jquery将.doc / .docx文件发送到webservice方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要做一个如下所示的示例页面,



名称:文本框

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屋!

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