IOS POST 数据,包括文件 到服务器
// Upload a file on disk
NSURL *url = [NSURL URLWithString:@"http://fox.xxx.cn/kids_file/js"];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
//NSFileManager *fileManager = [NSFileManager defaultManager];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [[paths objectAtIndex:0] stringByAppendingFormat:@"/painting/"];
NSString *writableDBPath = [documentsDirectory stringByAppendingPathComponent:@"smallerlogo.jpg"];
[request setPostValue:@"xiao fox 高峰君" forKey:@"name"];
[request setPostValue:@"girl" forKey:@"sex"];
[request setFile:writableDBPath withFileName:@"smallerlogo.jpg" andContentType:@"image/jpeg" forKey:@"photo"];
[request setDelegate:self];
[request startAsynchronous];