Iphone 如何使用ASIFormDataRequest从imagePickerController上载照片?
我使用UIImagePickerController的委托选择照片并将其放入服务器,但问题是我不知道如何使用ASIFormDataRequest实现这一点,我不知道info参数应该使用什么键Iphone 如何使用ASIFormDataRequest从imagePickerController上载照片?,iphone,cocoa-touch,ipad,asihttprequest,asiformdatarequest,Iphone,Cocoa Touch,Ipad,Asihttprequest,Asiformdatarequest,我使用UIImagePickerController的委托选择照片并将其放入服务器,但问题是我不知道如何使用ASIFormDataRequest实现这一点,我不知道info参数应该使用什么键 - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { NSString *str = [NSString stringWith
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
NSString *str = [NSString stringWithFormat:@"http://www.siteweb.com/api/v2/businesses/%@/pics.xml",entry.permalink];
NSURL *url = [NSURL URLWithString:str];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
request.delegate = self;
[request startAsynchronous];
[self dismissModalViewControllerAnimated:YES];
}
像这样:
[请求addFile:(NSString*)文件路径forKey:(NSString*)键]
事先获得如下图像:
UIImage*图像=(UIImage*)[信息
valueForKey:UIImagePickerControllerOriginalImage]
[UIImageJPEG表示(图像,1.0)写入文件:文件路径
原子上:是]
我必须使用imagePickerController,因此我可以使用info参数对路径执行什么操作?