Issue with uploading a video file using HTTP Post from iPhone app to server:
<p>I am trying to upload a .3gp video file into my server using HTTP post method from my iPhone app to my server. 3gp video file is available in my project resource. I use the following code for that,</p>

<pre><code>-(IBAction)buttonAction
{
    NSMutableURLRequest* post = [NSMutableURLRequest requestWithURL: [NSURL URLWithString: @"http://115.111.27.206:8081/vblo/upload.jsp"]];

    [post setHTTPMethod: @"POST"];


    NSString *boundary = [NSString stringWithString:@"---------------------------358734318367435438734347"];

    NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary];

    [post addValue:contentType forHTTPHeaderField: @"Content-Type"];


    body = [NSMutableData data];

    [body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]];

    [body appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"videofile\"; filename=\"video.3gp\"\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];

    [body appendData:[[NSString stringWithString:@"Content-Type: application/octet-stream\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];

    [body appendData:[[[NSBundle mainBundle] pathForResource:@"video" ofType:@"3gp"] 
                      dataUsingEncoding: NSASCIIStringEncoding]];

    [body appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]];


    [post setHTTPBody:body];

    NSData *returnData = [NSURLConnection sendSynchronousRequest:post returningResponse:nil error:nil];

    NSString *returnString = [[NSString alloc] initWithData:returnData encoding:NSUTF8StringEncoding];

    // Just to show the response received from server in an alert...
    UIAlertView *statusAlert = [[UIAlertView alloc]initWithTitle:nil message:(NSString *)returnString delegate:self cancelButtonTitle:@"cancel" otherButtonTitles:@"ok", nil];
    [statusAlert show];

}
</code></pre>

<p>This code doesn't do anything.</p>

<p>Could someone guide me what's wrong?</p>

<p>UPDATED:</p>

<p>I saw an example from the link -> iphone.zcentric.com/page/2 there are using "iphone.zcentric.com/test-upload.php"; PHP to upload and in my code i use JSP "115.111.27.206:8081/vblo/upload.jsp"; to upload to my server. Is this anything wrong here?</p>

<p>Thanks.</p>
