Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8322103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:15:52+00:00 2026-06-08T23:15:52+00:00

I am attempting to upload a large file from iOS to a server My

  • 0

I am attempting to upload a large file from iOS to a server

My code starts the webservce and after uploading ~180000 bytes it hangs, waits, and eventually times out.

As the code currently sits. (I have changed alot trying to troubleshoot)

AFHTTPClient *uploadClient = [[AFHTTPClient alloc] initWithBaseURL:[NSURL URLWithString:k_WebService_Root]];


NSMutableDictionary *parameters = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                   @"secret"                  , @"Token",
                                   nil];
NSDictionary *requestObject = [NSDictionary dictionaryWithObject:parameters forKey:@"request"];
NSString *endpoint = [self makeEndpointWithService:k_ServiceEndpoint_Message andAction:k_WebService_Message_Upload];

NSMutableURLRequest *request = [uploadClient multipartFormRequestWithMethod:@"POST" path:endpoint parameters:requestObject constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
    NSData *data = [NSData dataWithContentsOfFile: videoFile.path];
    [formData appendPartWithFileData:data name:@"file" fileName:@"message.mov" mimeType:@"video/quicktime"];
}];

AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];

[operation setUploadProgressBlock:^(NSInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) {
    NSLog(@"Sent %lld of %lld bytes", totalBytesWritten, totalBytesExpectedToWrite);
}];

[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
    NSLog(@"Success");
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
    NSLog(@"Fail\n%@", error);
}];


[operation start];

The Output always looks like this

2012-07-30 12:42:20.747 BMP[3290:3503] Sent 32768 of 2316966 bytes
2012-07-30 12:42:20.754 BMP[3290:3503] Sent 65536 of 2316966 bytes
2012-07-30 12:42:20.760 BMP[3290:3503] Sent 98304 of 2316966 bytes
2012-07-30 12:42:20.765 BMP[3290:3503] Sent 131072 of 2316966 bytes
2012-07-30 12:42:21.113 BMP[3290:3503] Sent 133452 of 2316966 bytes
2012-07-30 12:42:21.351 BMP[3290:3503] Sent 136148 of 2316966 bytes
2012-07-30 12:42:21.610 BMP[3290:3503] Sent 138844 of 2316966 bytes
2012-07-30 12:42:21.940 BMP[3290:3503] Sent 141540 of 2316966 bytes
2012-07-30 12:42:22.030 BMP[3290:3503] Sent 144236 of 2316966 bytes
2012-07-30 12:42:22.120 BMP[3290:3503] Sent 146932 of 2316966 bytes
2012-07-30 12:42:22.142 BMP[3290:3503] Sent 149628 of 2316966 bytes
2012-07-30 12:42:22.170 BMP[3290:3503] Sent 152324 of 2316966 bytes
2012-07-30 12:42:22.209 BMP[3290:3503] Sent 155020 of 2316966 bytes
2012-07-30 12:42:22.240 BMP[3290:3503] Sent 157716 of 2316966 bytes
2012-07-30 12:42:22.488 BMP[3290:3503] Sent 160412 of 2316966 bytes
2012-07-30 12:42:22.668 BMP[3290:3503] Sent 163108 of 2316966 bytes
2012-07-30 12:42:22.900 BMP[3290:3503] Sent 163840 of 2316966 bytes
2012-07-30 12:42:23.003 BMP[3290:3503] Sent 167152 of 2316966 bytes
2012-07-30 12:42:23.141 BMP[3290:3503] Sent 171196 of 2316966 bytes
2012-07-30 12:42:23.181 BMP[3290:3503] Sent 173892 of 2316966 bytes
2012-07-30 12:42:23.211 BMP[3290:3503] Sent 176588 of 2316966 bytes
2012-07-30 12:42:23.251 BMP[3290:3503] Sent 179284 of 2316966 bytes
2012-07-30 12:42:23.303 BMP[3290:3503] Sent 181980 of 2316966 bytes
2012-07-30 12:42:23.353 BMP[3290:3503] Sent 184676 of 2316966 bytes
2012-07-30 12:42:23.416 BMP[3290:3503] Sent 187372 of 2316966 bytes

And then after a few minutes i get a Timeout from AFNetworking

Any Ideas?

UPDATE :::
Apparently it only happens while uploading over 3G

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T23:15:54+00:00Added an answer on June 8, 2026 at 11:15 pm

    It turns out iOS limits uploads over 3G. I cannot find this documented anywhere from Apple.

    However
    Amazon has solved it for s# framework http://aws.amazon.com/articles/0006282245644577
    AFNetworking has a dev branch working on it (7/31/12) https://github.com/AFNetworking/AFNetworking/pull/418

    ASIHTTPRequest while out of date handles it and is my only hope http://allseeing-i.com/ASIHTTPRequest/How-to-use#throttling_bandwidth

    Good Luck to anyone who encounters this in the future.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been unsuccesfully attempting to upload an encrypted file to an FTP server,
I am attempting to upload a file from my html page to my servlet
When attempting a file upload to an Alfresco Server using ssl the server logs
I am attempting to let a client upload a file to my server in
I currently need to upload large files from an iDevice to a server API.
I am attempting to upload multiple files from a Silverlight client directly to Amazon
I am getting an internal server error when I am attempting to upload images
I am attempting to use FTP in Powershell to upload a file. I am
I'm attempting to upload a file into a jsp and then use the file
I am attempting to upload files to my server using ASP.NET MVC. Here is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.