rigof Posted January 16, 2013 Share Posted January 16, 2013 Hi Guys, I been googling every where to find some code sample that will enable me to upload multiple photos from an iphone running IOS 6 to a website. According to what I had read, Safari for IOS supports this by using a mutiple boolean value in an input tag. And that works fine. When the button is pressed to select pictures I am able to select multiple pictures, what I can't seem to figure out is how on the server side I can grab those multiple images selected. Here is code sample( I found online not mine) that I was able to use . And it works fine with 1 image; I can upload the image. But with 2 or more I can't seem to figure out how to make it happen. Thank you. <?php $result=0; if (trim($_POST["action"]) == "Upload File") { //**** User Clicked the Upload File Button //*********** Execute the Following Code to Upload File ************* $imagename = basename($_FILES['image_file']['name']); // grab name of file $result = @move_uploaded_file($_FILES['image_file']['tmp_name'], $imagename); // upload it if ($result==1) echo("Successfully uploaded: <b>".$imagename."</b>"); // did it work? } // end if ?> <html> <head> <title>Upload file script</title> </head> <body> <form method='POST' enctype='multipart/form-data' name='frmmain' action='up2.php'> Browse for Image (jpg): <input type="file" name="image_file" size="35"> <br> <input type="submit" value=" Upload File " name="action" multiple> </form> <br> <?php if ($result==1) echo("<img src='".$imagename."'>"); // display the uploaded file ?> </body> </html> Can any one help me figure out how I can make this happen? Quote Link to comment https://forums.phpfreaks.com/topic/273248-ios-60-safari-multiple-photo-upload/ Share on other sites More sharing options...
Christian F. Posted January 17, 2013 Share Posted January 17, 2013 You need to check out the $_FILES array, in order to find the information you're looking for. I recommend reading the Handling file uploads section in the PHP manual, for more information on how to properly handle uploads. Also, remember to properly validate your input, and make sure that the pictures are indeed pictures. This last part can be done with the GD functions. Quote Link to comment https://forums.phpfreaks.com/topic/273248-ios-60-safari-multiple-photo-upload/#findComment-1406350 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.