Safari PHP 表单提交 - 文件上传挂起 [英] Safari PHP form submission -file upload hangs

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

问题描述

我对 safari 5+ 有疑问.当客户端通过简单的 HTML 表单选择要上传的图像文件时,Safari 5.1 的 MAC 版本(迄今为止我发现的唯一一个这样做的浏览器)会无限期地挂起.

I have an issue with safari 5+. When client selects the image file to upload through a simple HTML form the MAC version of Safari 5.1 (so far the only browser I found which is doing this) keeps hanging indefinitely.

我在 php.ini 中正确设置了我的上传时间和大小,它可以在所有其他浏览器(FF、Opera 甚至 IE!)中工作,所以我不认为我在 HTML 或 PHP 中有一些新手错误.

I have my upload time and size in php.ini set correctly and it works in all other browsers (FF, Opera even IE!) so I do not suppose I have some rookie mistake in the HTML or PHP.

我搜索了很多帖子,发现了与此问题相关的错误报告 (https://bugs.webkit.org/show_bug.cgi?id=5760).我还发现了几个 Ajax 解决方法,但没有一个是合适的.我没有在这个页面上使用 Ajax,实际上是因为我不想使用重定向.

I have searched through many posts and found a bug report which is related to this issue (https://bugs.webkit.org/show_bug.cgi?id=5760). Also I found several Ajax workarounds but none of them has been the right fit. I am not using Ajax on this page and actually due to redirects I do not want to anyway.

有人知道解决办法吗?

还有.... 像添加 < 这样的建议?header('连接:关闭');?> 到文件使 Opera 的情况变得更糟.

Also.... suggestions like adding <? header('Connection: close'); ?> to the file make things worse for Opera.

2013 年 4 月 10 日我仍然不明白为什么 Safari 会挂在一些图片上传上.我正在进行此编辑,以防有人遇到类似问题.顺便说一句,当 Safari 在 VirtualBox 中运行时,每次上传都会失败,这与 Firefox 或 IE 工作正常.(也许是设置问题?)

April 10, 2013 I still did not figure out why Safari hangs on some image uploads. I am making this edit in case someone has a similar problem. BTW when Safari is ran in the VirtualBox the upload fails every time unlike Firefox or IE which works fine. (perhaps a settings issue?)

我发现这个变通方法非常容易实现,并且目前适用于我可以测试的所有主流浏览器.(来源:http://www.atwebresults.com/php_ajax_image_upload/ )但是最初的问题仍然存在.谢谢.

I found this workaround which is very easy to implement and so far worked with every mainstream browser I could test. (Source: http://www.atwebresults.com/php_ajax_image_upload/ ) However the original question still stands. Thank you.

推荐答案

lighttpd 的解决方法:

A workaround for lighttpd:

$HTTP["useragent"] =~ "Safari" {
$HTTP["useragent"] !~ "Chrome" {
  server.max-keep-alive-requests = 0
}
}

Jamis Buck 发现了它,我添加了配置行.第二条规则避免将 keepalive 限制在 Chrome 上,Chrome 也有 Safari 子字符串.感谢 https://bugs.webkit.org/show_bug.cgi?id=5760

Jamis Buck discovered it and I added the config lines. The second rule avoids restricting keepalives to Chrome which also has the Safari substring. Courtesy of https://bugs.webkit.org/show_bug.cgi?id=5760

这篇关于Safari PHP 表单提交 - 文件上传挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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