文件上传不工作如果部署到服务器 [英] File Uploads Not Working When Deployed To Server

查看:194
本文介绍了文件上传不工作如果部署到服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始创建我自己的异步文件上传组件ASP.NET的努力。我把经验教训形式达伦·约翰斯通的文件上传项目,并创建了一个HttpModule从提交的数据中提取的文件。

I recently embarked on the endeavor of creating my own asynchronous file upload components for ASP.NET. I took lessons learned form Darren Johnstone's FileUpload project and created an HttpModule for extracting the files from the submitted data.

我得到的一切,因为它应该在VS 2008中使用的测试开发服务器的工作。我甚至我的测试过程中竟然以确保请求正在由模块截获文件开始上传之前。我满意的事情后,我部署项目,我们的Web服务器(2008年赢W / IIS 7)。我震惊地得知,部署在对照组无法正常工作。

I got everything working as it should in testing with VS 2008 using the Development Server. I even went so far during my testing to ensure that the request was being intercepted by the module before the files began uploading. After I was satisfied with things, I deployed the project to our web server (Win 2008 w/ IIS 7). I was horrified to learn that the controls were not functioning when deployed.

一些远程调试后,我发现HttpApplication.AuthenticateRequest事件(我的位置挂接到进程)并没有被调用,直到文件被完全上传

After some remote debugging, I found that the HttpApplication.AuthenticateRequest event (my location for hooking in to the process) was not being invoked until the files were completely uploaded.

我已签,我能想到的一切,仍一直无法找到的这种行为改变的原因。任何想法?

I have checked everything that I can think of, and still have been unable to find a reason for this change in behavior. Any ideas?

推荐答案

我的猜测是,ASP.NET运行时不与服务器上的IIS运行时集成模式下运行,因此文件上传已在完全缓冲在IIS宿主进程,才可以被传递到ASP.NET运行时。

My guess is that the ASP.NET runtime is not running in integrated mode with the IIS runtime on the server, so the file upload has to be completely buffered in the IIS host process before it can be passed to the ASP.NET runtime.

这可以解释为什么请求管道无法触发,直到数据被完全上传

This would explain why the request pipeline is not firing until the data is completely uploaded.

检查服务器的配置,并确保整合模式为ASP.NET应用程序启用。

Check the configuration of the server and ensure that integrated mode is enabled for the ASP.NET application.

这篇关于文件上传不工作如果部署到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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