我在本地机器(mac osx 默认服务器)上设置了这个多文件上传插件(https://github.com/blueimp/jQuery-File-Upload)。一切正常,当我上传图片时,我收到了这个回复
[{
"name":"subaru-wrx-poster-i3(1).jpg",
"size":142583,"type":"image\/jpeg",
"url":"http:\/\/shipwatchpointe.dev\/bundles\/jupload\/uploads\/files\/52\/subaru-wrx-poster-i3%20%281%29.jpg",
"thumbnail_url":"http:\/\/shipwatchpointe.dev\/bundles\/jupload\/uploads\/thumbnails\/52\/subaru-wrx-poster-i3%20%281%29.jpg",
"delete_url":"http:\/\/shipwatchpointe.dev\/upload\/upload\/?file=subaru-wrx-poster-i3%20%281%29.jpg&_method=DELETE",
"delete_type":"POST"
}]
但是,我刚刚推送到 EC2 实例上的暂存区域,现在我收到了此响应
//
前端有一个错误,上面写着......
SyntaxError: Unexpected token /
我在我能想到的任何地方都扔了一堆骰子,但我没有到达它们并且仍然得到相同的响应。EC2 实例正在运行 Ubuntu 12.10,我确保在 /etc/mime.types 中存在 application/json json,但由于某种原因,它看起来仍在尝试将其呈现为 html 并向我抛出该错误。在我的本地服务器上不存在的暂存服务器上可能存在什么问题?我可以粘贴我的代码,但我怀疑有很多片段可能会导致问题。
编辑 这是我本地服务器上的响应标头(工作正常)
Accept-Ranges:bytes
Connection:Keep-Alive
Content-Length:1532
Content-Type:image/png
Date:Wed, 03 Apr 2013 18:13:47 GMT
ETag:"30d598-5fc-4d978d09b8a80"
Keep-Alive:timeout=5, max=100
Last-Modified:Wed, 03 Apr 2013 18:13:46 GMT
Server:Apache/2.2.22 (Unix) DAV/2 PHP/5.3.15 with Suhosin-Patch mod_ssl/2.2.22
OpenSSL/0.9.8r
这是我的登台服务器上的响应标头(不工作)
Connection:Keep-Alive
Content-Encoding:gzip
Content-Length:23
Content-Type:text/html
Date:Wed, 03 Apr 2013 18:07:24 GMT
Keep-Alive:timeout=5, max=100
Server:Apache/2.2.22 (Ubuntu)
Vary:Accept-Encoding
X-Powered-By:PHP/5.3.10-1ubuntu3.6