title: Upload a file to server to show UIProgressView in iPhone?
body: <p>I have upload a file through my server and its working fine, but i want to show a progressview for upload status, How to do this, Please help me</p>
  
  <p>Thanks in Advance</p>
  
  <p>I tried this:</p>
  
  <pre><code>        [body appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"file\"; filename=\"%@\"\r\n",file] dataUsingEncoding:NSUTF8StringEncoding]];
          [body appendData:[[NSString stringWithString:@"Content-Type: application/octet-stream\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
          [body appendData:Filedata];
          [body appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]];
          [request setHTTPBody:body];
  
  
          NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:request delegate:self];
          if (theConnection)
              mutaebleData = [[NSMutableData data] retain];
          else
              NSLog(@"No Connection");
  </code></pre>
  
  <p>Using this delegate to Upload data status, but it wont help</p>
  
  <pre><code>- (void)request:(NSURLConnection *)request 
  didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite
  {
      NSLog(@"%d bytes out of %d sent.", totalBytesWritten, totalBytesExpectedToWrite);
  }
  </code></pre>