使用WCF上传Jquery文件 [英] Jquery File Upload with WCF

查看:89
本文介绍了使用WCF上传Jquery文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧我们使用库jquery文件上传时遇到问题( http://blueimp.github.io/jQuery -File-Upload / [ ^ ] )。



我从文档页面下载了一个示例,它是ASP.NET示例(服务器端asp列表中的4º),尽管此解决方案还没有WCF(我是asp新手......)所以我可以调用一个wcf函数将文件保存在filetransferhandler.ashx中 - 函数UploadWholeFile?



或者如何我可以连接到WCF吗?



最好的问候。

Well guys i have a problem using the library jquery file upload (http://blueimp.github.io/jQuery-File-Upload/[^]).

I have downloaded an example from documentation page wich is ASP.NET example (4º in the list of server-side asp) although on this solution has not a WCF (i am new at asp...) so from i can call a wcf function to save the file in the filetransferhandler.ashx - function UploadWholeFile ?

Or how can I connect to WCF?

best regards.

推荐答案

我知道的唯一方法上传文件是为了实际做一个帖子。我已经实现了一个jquery版本但它所做的只是创建一个iframe并从那里上传文件,发布到我的处理程序(ashx)。



Javascript本身不能做文件上传。
The only way I am aware of to upload a file is to actually do a post. I have implemented a jquery version but all it did was create an iframe and do the file upload from there, posting to my handler (ashx).

Javascript itself cannot do a file upload.


在考虑了几天之后,



你可能只需要调整HTTpHandler,并确保保存文件上传的物理路径存在。



因此网页保存文件上传触发器

客户端激活在浏览器中上传文件,

您单击触发器,选择文件,HTTP Handler在后台上传文件。网页就在那里,并在处理程序完成后使用JSON和Javscript更新任何更改。



调试Web应用程序,加载HTTP处理程序页面代码,然后选择第一行有一个断点。 F9



如果断点未命中,则客户端不指向HTTP处理程序。处理程序必须加载才能上传文件。



如果你点击断点,然后走它以找到你的错误点。



如果是路径,请做一个简单的测试路径,然后在修复后,制作你真正想要的路径。
After thinking about it for a couple of days,

You probably just need to adjust the HTTpHandler, and make sure the physical path that your saving the file upload to exist.

So the Webpage holds the file upload trigger
The client activate the file upload in the browser,
You click the trigger, select the file, and the HTTP Handler uploads the file in the background. The webpage just sites there and updates any changes using JSON and Javscript when the Handler is done.

So Debug your Web App, load the HTTP Handler page code, and select the first line with a break point. F9

If the breakpoint does not hit, then the client is not pointing to the HTTP Handler. The Handler has to load in order to upload the file.

If you hit the breakpoint, then walk though it to find your error point.

If it's the path, make a simple path for testing, and then when fixed, make the path you really want.


这篇关于使用WCF上传Jquery文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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