title: Upload an sqlite file
body: <p>I'm using AFNetworking to try to upload a file:</p>
  
  <pre><code>-(void)uploadFile{
  
      NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
      NSString *documentsDirectory = [paths objectAtIndex:0];
      NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"data.sqlite"];
      NSURL *filePathURL = [NSURL fileURLWithPath:filePath];
  
      NSMutableURLRequest *request = [[AFHTTPRequestSerializer serializer] multipartFormRequestWithMethod:@"POST" URLString:@"http://localhost:8888/myApp/upload.php" parameters:nil constructingBodyWithBlock:^(id&lt;AFMultipartFormData&gt; formData) {
          [formData appendPartWithFileURL:filePathURL name:@"file" fileName:@"data.sqlite" mimeType:@"text/html" error:nil];
      } error:nil];
  
      AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
      NSProgress *progress = nil;
  
      NSURLSessionUploadTask *uploadTask = [manager uploadTaskWithStreamedRequest:request progress:&amp;progress completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
          if (error) {
              NSLog(@"Error: %@", error);
          } else {
              NSLog(@"Success: %@ %@", response, responseObject);
          }
      }];
  
      [uploadTask resume];
  }
  </code></pre>
  
  <p>And this php file <code>upload.php</code>:</p>
  
  <pre><code>&lt;?php
  
      $uploaddir = 'uploads/';
      $file = basename($_FILES['uploadedfile']['name']);
      $uploadfile = $uploaddir . $file;
  
      echo "file=".$file;
  
      if (move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $uploadfile)) {
          echo $file;
      }
      else {
          echo "error";
      }
      ?&gt;
  </code></pre>
  
  <p>It's printing:</p>
  
  <blockquote>
    <p>Error Domain=com.alamofire.error.serialization.response Code=-1016
    "Request failed: unacceptable content-type: text/html"
    UserInfo=0x7b8b2bf0</p>
  </blockquote>
  
  <p>Is the problem from the <code>mimeType</code> ? I also used <code>application/x-sqlite3</code> content type in both iOS and php sides.</p>