本文介绍了Mac上的Safari 5挂起上传文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一位正在使用最新版本的OSX和Safari的用户。当他试图通过表单上传一个文件时,它会挂起(微调旋转),但什么也没有发生。我做了一些研究,发现这一点:

http://blog.sina.com.cn/u/blogspot - 基于4个网页b

这个修正了以前版本Safari的问题,但显然不是Safari 5.

我想知道是否有人有任何想法如何解决这个问题?有人提到它与持久的http连接(因此上面的修复)有关,我使用PHP(但我不认为这很重要)。

解决方案我已经有一些成功的发送连接:关闭标题来解决这个问题。

添加

  header(connection:close); 

添加到处理文件上传的代码中。它似乎并没有解决100%的问题,但它肯定会改善它。请注意,它是区分大小写的:连接:关闭将无法正常工作。


I have a user who is using the latest version of OSX and Safari. When he tries to upload a file through a form, it hangs (spinner spinning) but nothing happened. I did some reasearch and found this:

http://airbladesoftware.com/notes/note-to-self-prevent-uploads-hanging-in-safari

This fixed problems in previous versions of Safari, but obviously not Safari 5.

I was wondering if anyone else has any ideas how to resolve this? There was some mentioned of it being related to persistent http connections (thus the fix above) and I am using PHP (but I don't think that matters).

解决方案

I've had some success sending the connection: close header to solve this issue.

Add

 header("connection: close");

to the code that handles the file upload. It doesn't seem to solve the issue 100% but it certainly improves it. note that it's case sensitive: "Connection: close" won't work.

这篇关于Mac上的Safari 5挂起上传文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 22:14