AFNetworking 3.x multipart form upload
<p>I have an upload form like this:</p>

<pre><code>&lt;form action="http://localhost/upload.php" method="post" enctype="multipart/form-data"&gt;
    &lt;input type="file" id="upload" name="upload" /&gt;
&lt;/form&gt;
</code></pre>

<p>and php code to proceed upload form:</p>

<pre><code>isset($_FILES["upload"]) or die("Error");
// Path prepare stuff
if (move_uploaded_file($_FILES["upload"]["tmp_name"], $outputFile)) {
    // Other processing stuffs
}
</code></pre>

<p>In xcode, Im constructing the request like this:</p>

<pre><code>NSMutableURLRequest* request = [[AFHTTPRequestSerializer serializer]
                                multipartFormRequestWithMethod:@"POST"
                                URLString:@"http://localhost/upload.php"
                                parameters:nil
                              constructingBodyWithBlock:^(id&lt;AFMultipartFormData&gt;  _Nonnull formData) {
                                    [formData appendPartWithFormData:data name:@"somefilename.ext"];
                                } error:nil];
</code></pre>

<p>But seem like i did it wrong way, right?</p>

<p><strong>UPDATE</strong></p>

<p>Im new to AFNetworking and I want to understand how it constructs multiplart/form-data post like above. It looks like the code lack of the input's name "upload", hence will not be able to pass the first line of php upload script. I read the document from AFNetworking's GitHub, but they say nothing about constructing a form data with NSData which is the case here.</p>