Jump to content

Multiple file upload plus folder upload


dropfaith

Recommended Posts

what i need to do  is upload 4 files and a folder of files im building a gallery script and the 4 pics are sample photos then the folder would be the full set of images .

 

i need it so it posts the files to server and where they are so i can later pull them out for this

http://dropfaithproductions.com/test/pinup.php then clicking on the sample is going to load a slideshow with a xml playlist of images(which i can handle its just uploading and inserting ill have issues with..

 

 

Link to comment
https://forums.phpfreaks.com/topic/122204-multiple-file-upload-plus-folder-upload/
Share on other sites

my bad  what im looking for is basic advice on how to accomplish the upload of 4 files then wondering (as im clueless on this part) how i could upload a entire set of images with a single upload (whether its a folder or a zip file that then get unzipped when it gets to server)not sure whats possible here as its my first attempt at file uploads..

 

 

So any advice on the best way to build an image galley

 

http://dropfaithproductions.com/test/add.php is a copy of the form i want to write the code to submit it all..

 

 

I'm not sure (or not aware) that you can let users specify a folder and grab all it's files. As for the zip, PHP has some archive extensions that will do the work, but I'm not sure if you're willing to go into them. The best way here should be giving the users 4 file upload fields which make up an array like this:

 

<input type="file" name="photos[]">
<input type="file" name="photos[]">

 

And the php code to grab them:

<?php
$photos = $_FILES['photos']['name']; //$photos will become an array
print_r($photos); //you get all the filenames here
if(count($photos) == 4){ //check if all four files are uploaded
     //the file processing code
} else{
     echo 'Please upload all the four images';
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.