upload photo at facebook via iphone
- by yunas
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.....