Blobstore and AsiHttpRequest in iOs

72 views
Skip to first unread message

Gal Skarishevsky

unread,
Mar 2, 2012, 4:34:14 AM3/2/12
to google-a...@googlegroups.com
hi,
I'm trying to store a blob with AsiHttpRequest in iOS and something doesn't work well.
when I'm asking the blobstoreserivce to produce an upload link it does the job. but when I'm trying to post to this link it gets back wit this error

<!DOCTYPE html>

<html lang=en>

  <meta charset=utf-8>

  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">

  <title>Error 411 (Length Required)!!1</title>

  <style>

    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7 0x1.af7f000047242p-784uto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 1000x62c5cx no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}

  </style>

  <a href=//www.google.com/><img src=//www.google.com/images/errors/logo_sm.gif alt=Google></a>

  <p><b>411.</b> <ins>That’s an error.</ins>

  <p>POST requests require a <code>Content-length</code> header.  <ins>That’s all we know.</ins>



thats my iOS code



    NSData *imageData = [NSData dataWithData:UIImageJPEGRepresentation(img, 0.5)];


    self.formData = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:uri]];

    [self.formData setData:imageData withFileName:@"gal.jpg" andContentType:@"image/jpg" forKey:@"myFile"];

    [self.formData setDelegate:self];

    [self.formData setUploadProgressDelegate:self];

    [self.formData setPostFormat:ASIMultipartFormDataPostFormat];

    [self.formData startAsynchronous];



ill be glad for some help
Gal





Reply all
Reply to author
Forward
0 new messages