3

我有一个页面,允许用户在 jquery.form.js 插件的帮助下使用 AJAX 上传 2 个文件。

此过程在任何其他浏览器上运行良好,但当您尝试仅在 Safari/Mac 上(在 SSL 后面)上传第二个文件时会失败。未使用 SSL 的 qa 环境中的同一页面在 Safari 中运行良好!

查看应该上传文件的服务的浏览器日志,我得到一个 500 Internal Server Error 的尝试。

在服务器上调试时,我们发现错误出在 apache 多部分请求解析器中。似乎很难找到图像文件部分。

我找不到有关类似问题的任何信息,非常感谢您的建议。

谢谢!

<form id="fileupload-before" method="post" name="fileupload-before" action="/registration/RegImage.do" enctype="multipart/form-data">
<div id="beforeimageBtn" class="bt_uploadPhoto_holder" replace="bt_uploadPhoto_holder">
<input type="file" name="before" id="fileupload-before-field" onchange='getFilenamebefore();'>
</div>
</form>

<form id="fileupload-after" method="post" name="fileupload-after" action="/registration/RegImage.do" enctype="multipart/form-data">
<div class="bt_uploadPhoto_holder" id="afterimageBtn" replace="bt_uploadPhoto_holder" >
    <input type="file" name="after" id="fileupload-after-field" onchange='getFilenameafter();'>
</div>
</form>

(文件输入字段被隐藏(不透明度:0)并由按钮提供。)

4

1 回答 1

0

确保您拥有:

enctype="multipart/form-data"

在你的<form>标签中。

于 2012-04-04T20:00:24.730 回答