I am using the following code (with ASIHTTPRequest) to attempt to upload php files from my iPhone to my LAN MAMP server running on my Macbook Pro. My objective-c and my php seem to be in line, but the files are not uploading.
OBJECTIVE-C CODE
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *path = [paths objectAtIndex:0];
[path stringByAppendingPathComponent:[pieces objectAtIndex:indexPath.row]];
NSURL *url = [NSURL URLWithString:@"http://192.168.1.102:8888/upload.php"];
ASIFormDataRequest *request = [[[ASIFormDataRequest alloc] initWithURL:url] autorelease];
[request setFile:path forKey:@"file"];
PHP CODE
<?php
$target = "uploads/";
$target = $target . basename( $_FILES['file']['name']) ;
$ok=1;
(move_uploaded_file($_FILES['file']['tmp_name'], $target));
?>
What is going wrong here?
Thanks,
James