防止大上传时会话超时

发布于 2024-08-16 10:32:09 字数 102 浏览 0 评论 0原文

我想从标题中可以明显看出:)

好吧,问题是,如果用户上传一个大文件,他的会话可能会超时。如何防止会话超时?

我使用 Struts2 和 AjaxUpload。

Pretty obvious from the title I guess :)

Well, problem is that if user is uploading a big file, his session might timeout in that time. How could I prevent session timeouts?

I am using Struts2 with AjaxUpload.

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

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

发布评论

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

评论(1

转瞬即逝 2024-08-23 10:32:09

以小于会话超时的时间间隔向服务器发出另一个请求(并行)。

(这当然只是在上传未完成的情况下进行。)

例如,每隔 X 秒使用 AJAX / Iframe / Image 标签请求图像 / URL(现有或缺失)(如果您的会话超时为 30,我会尝试 20)或 15 只是为了确保...

注意:如果您请求丢失的 URL/图像,您将在日志中生成 404,如果您请求真实的 URL/图像,请确保它被缓存并且永不过期,以避免堵塞

。我们...

Have another request (in paralel) to the server in intervals smaller than the session timeout.

(This is of course only as long as the upload is not finished.)

e.g. request for an image / URL (existing or missing) using AJAX / Iframe / Image tag every X seconds (if your session timeout is 30, I would try 20 or 15 just to make sure...

Notes: If you request a missing URL / Image you will result in a 404 in the logs and if you request a real URL / Image make sure it is cached and never expires to avoid clogging

Works for us...

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