上传时我无法打开网站上的其他页面?

发布于 2024-12-29 19:13:59 字数 169 浏览 3 评论 0原文

我的网站在 IIS7 上运行,所有脚本均以 ASP Classic 编码。我最近注意到在我的网站上上传文件时我无法打开任何其他页面。

这是场景: 我开始使用网络表单上传视频文件,在上传文件时,我尝试在同一网站上打开另一个页面,但除非上传完全完成,否则它不会接收和加载单个字节!

有什么想法吗?

My website runs on IIS7 and all scripts are coded in ASP Classic. I recently noticed while uploading a file on my website I cannot open any other pages.

This is the scenario:
I start uploading a video file using a web form, while the file is being uploaded I attempt to open another page on the same website but it wouldn't receive and load a single byte unless the upload is fully done!

Any thoughts?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

暖心男生 2025-01-05 19:13:59

Session 对象就是造成这种情况的原因。 Session 对象属于 STA(单线程单元)。当属于特定会话的请求到达时,处理该请求的工作线程将进入会话对象所属的单元。然而,只有如果该单元中已经没有其他线程,它才能做到这一点(因为 STA 一次只能容纳一个线程)。

因此,您的浏览器开始上传文件,并且正在执行与该浏览器会话关联的 ASP 请求。处理该上传请求的工作线程进入会话对象所属的单元。现在,您正在尝试加载另一个页面,而其他请求仍在进行中。当第二个请求到达时,ASP 会发现它无法让另一个工作线程进入相同的会话单元,因为它已经被第一个请求占用了。因此,ASP 会将第二个请求放入队列中,等待第一个请求腾出公寓。

避免这种情况的唯一方法是关闭 ASP 会话。这将允许 ASP 同时处理来自同一浏览器的请求。然而,严重的缺点是您将不再有 Session 对象可以使用。您必须自己实现任何服务器端会话管理,包括处理并发问题,例如两个请求同时尝试访问任何会话数据。

The Session object is the cause of this. The Session object belongs to an STA (single threaded apartment). When a request arrives belonging to a specific session the worker thread handling the request will enter the apartment that the session object belongs to. However it can only do that if there is not another thread already in that apartment (because an STA can only accomodate one thread at a time).

So your browser starts uploading a file, an ASP request is being executed that is associated with that browser's session. A worker thread handling that upload request enters the apartment to which the session object belongs to. Now you are trying to load another page while that other request is still in progress. When this second request arrives ASP will find that it can't get another worker thread to enter the same sessions apartment because its already occupied with the first request. Hence ASP will place this second request in a queue waiting for the first to vacate the apartment.

The only way to avoid this would be to turn off ASP sessions. This would allow ASP to process requests from the same browser at the same time. However the serious downside is you will no longer have a Session object to work with. You would have to implement any server-side session management yourself including handling concurrency issues such as two requests trying to access any session data at the same time.

猥︴琐丶欲为 2025-01-05 19:13:59

只有您的网站打不开还是其他网站也打不开?

如果是后者,请为您的互联网购买更好的套餐。

Only your site doesn't open or other sites too?

If its latter, buy a better package for your internet.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文