upload photo at facebook via iphone

Posted by yunas on Stack Overflow See other posts from Stack Overflow or by yunas
Published on 2010-03-20T13:15:37Z Indexed on 2010/03/20 13:21 UTC
Read the original article Hit count: 370

Filed under:
|
|
|

hello i am trying to upload my image from myapplication but not able to do so.... i have tried

ASIFormDataRequest *theRequest = [ASIFormDataRequest requestWithURL:url];

NSString *nowTimestamp = [NSString stringWithFormat:@"%f",[[NSDate date] timeIntervalSince1970]];

[theRequest setPostValue:kApiKey forKey:@"api_key"]; [theRequest setPostValue:(float)[[NSDate date] timeIntervalSince1970] forKey:@"call_id"]; [theRequest setPostValue:@"1.0" forKey:@"v"]; [theRequest setData:[NSString stringWithString:@"abc"] forKey:@"status"]; [theRequest setPostValue:[NSString stringWithFormat:@"%lld",session1.uid] forKey:@"uid"]; NSLog(@"%lld",session1.uid);

NSString *strSig = [[NSString alloc] init];

strSig = [strSig stringByAppendingString:[NSString stringWithFormat:@"@=%@",@"api_key",kApiKey]]; StrSig = [strSig stringByAppendingString:[NSString stringWithFormat:@"@=%@",@"call_id",nowTimestamp]]; strSig = [strSig stringByAppendingString:[NSString stringWithFormat:@"%@=%@",@"v",@"1.0"]]; strSig = [strSig stringByAppendingString:[NSString stringWithFormat:@"%@=%@",@"uid",[NSString stringWithFormat:@"%lld",session1.uid]]];

strSig = [strSig stringByAppendingString:kApiSecret];

[theRequest setPostValue:[self md5:strSig] forKey:@"sig"];
[theRequest setURL:url];
[theRequest setRequestMethod:@"POST"];
[theRequest setPostFormat:ASIMultipartFormDataPostFormat]; 
[theRequest startSynchronous]; 

but it says that signature is incorrect .... where i am wrong please help me.....

© Stack Overflow or respective owner

Related posts about iphone

Related posts about facebook