ios - NSURLSessionUploadTask doesn't send the whole file -
I came into an issue trying to send a file with a NSURLSessionUploadTask
in a custom REST service The problem is that the file is being moved to arbitrary size, and then the task is without any error ( URL session: the operation was done:
to error
Is called zero
).
The file that needs to be moved is about 10 MB in size, and I think the small files are sometimes transferred properly.
I am using the following functions to use the code:
NSMutableURLRequest * request = [[NSMutableURLRequest alloc] init]; [Request URL: url]; [Request Set Value: @ "App / Jason; Charset = UTF-8" forHTTPHeaderField: @ "Content-Type"]; [Request Set Value: @ "100-Release" for HTTP headerfield: @ "Hope"]; [Set http system: @ "post"]; [Request Set Value: [NSString stringWithFormat: @ "% d", length] forHTTPHeaderField: @ "Content-Length"]; Ns url * file url = [nsur file URL with path: example filepath]; NSURLSessionUploadTask * uploadtask = [auto. UploadTask WithRequest: Requested File: fileUrl];
I need to specify some headers for the server so that the request can be understood correctly and the effective size of the length
variable file is being sent.
Any ideas about what's going on here?
Thank you.
Comments
Post a Comment