for example
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request setPostValue:@"Ben" forKey:@"name"];
[request setPostValue:imageData forKey:@"image"];
[request setPostValue:imageData1 forKey:@"image"];
[request setPostValue:imageData2 forKey:@"image"];
[request setPostValue:imageData3 forKey:@"image"];
[request startSynchronous];
Is it ok to post these images all using the same named key ‘image’ or would the php file become confused.
According to the HTTP specification, it is valid to have the same key in a request more than once. But PHP will loose some of the data, depending how you access it.
You should add square braces to your key, which will be converted to an array in the PHP code:
And in your PHP:
You can also do an associative array:
Gives:
And you can also do nested arrays:
Gives: