ChrisRockC / MyWiki

点-线-面
0 stars 0 forks source link

上传拍摄图片不成功 #257

Open ChrisRockC opened 6 years ago

ChrisRockC commented 6 years ago

Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: request too large (413)" UserInfo={NSLocalizedDescription=Request failed: request too large (413), NSErrorFailingURLKey=http://116.62.130.144:8087/ServerOnline/file/test, com.alamofire.serialization.response.error.data=<3c68746d 6c3e0d0a 3c686561 643e3c74 69746c65 3e343133 20526571 75657374 20456e74 69747920 546f6f20 4c617267 653c2f74 69746c65 3e3c2f68 6561643e 0d0a3c62 6f647920 6267636f 6c6f723d 22776869 7465223e 0d0a3c63 656e7465 723e3c68 313e3431 33205265 71756573 7420456e 74697479 20546f6f 204c6172 67653c2f 68313e3c 2f63656e 7465723e 0d0a3c68 723e3c63 656e7465 723e6e67 696e782f 312e352e 343c2f63 656e7465 723e0d0a 3c2f626f 64793e0d 0a3c2f68 746d6c3e 0d0a>, com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x1c0a391a0> { URL: http://116.62.130.144:8087/ServerOnline/file/test } { status code: 413, headers { Date = Wed, 02 May 2018 06:47:27 GMT; Content-Length = 198; Connection = close; Content-Type = text/html; Server = nginx/1.5.4; } }}

ChrisRockC commented 6 years ago

HTTP Status 413 (请求实体过大) ->服务器无法处理请求,因为请求实体过大,超出服务器的处理能力。

ChrisRockC commented 6 years ago

用的第三方并没有对拍摄的图片进行压缩

ChrisRockC commented 6 years ago

NSData* data = UIImageJPEGRepresentation(editedImage, 0.1);