I use below code to send a file to the server:
NSString *urlString = [NSString stringWithFormat:@\"%@%@\",[LIUtility sharedUtility].uploadConnectionURL,BR_S
I finally solved my problem by adding Content-Length
to the request.
When we do not add the Content-Length
header to the request, NSURLConnection
send it as a chunked
request and it seems such problems is common with chunked requests.
Actually I do not found the root cause of the problem with this chunked
request (I searched many subjects in web, reads many articles, talked with several other programmers but do not find any root cause, so I decide to use the other solution ) but I shared this solution for someone that can use non-chunked request in their business. As I know most usages of chunked requests are in real time streaming that we do not know the Content-Length
so if you can add Content-Length
, I suggest to use it for avoiding chunked problems like this.