How to upload photo by using ASIFormDataRequest without upload.php file?

324 views
Skip to first unread message

Dương Diệu Pháp

unread,
Feb 26, 2012, 9:19:18 AM2/26/12
to asihttp...@googlegroups.com
Hi everyone, I have a problem when try to upload photo by using ASIFormDataRequest without upload.php, my host doesn't support PHP file?

The upload URL is  http://rolo.vn/p/lsphoto.html?aid=vnlk7b347b (aid is _albumID)

This is my code:


NSData *imageData = UIImageJPEGRepresentation(imageView.image, 100);
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:@"http://rolo.v/p/lsphoto.html"]];
request.requestMethod = @"POST";            

[request addData:imageData withFileName:@"image.jpg" andContentType:@"image/jpeg" forKey:@"image"];
[request setPostValue:_albumID forKey:@"aid"];
[request startAsynchronous];

Thank you!
Reply all
Reply to author
Forward
0 new messages