I have downloaded a script for a multiple file upload. I wanted to edit it with a list box, so that what option the user chooses with the list box decides what directory the file will be uploaded to.
Here is the upload page.
<table width="500" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<form action="multiple_upload_ac.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1">
<tr>
<td>Please Select a Gallery:</td>
</tr>
<tr>
<td><select name="gallery">
<option value="images/gallery/upload/HarlanSpring08">Harlan Spring '08</option>
<option value="HarlanFall08">Harlan Fall '08</option>
<option value="Local">Local</option>
<option value="Tellico06">Tellico '06</option>
<option value="Tellico07">Tellico '07</option>
<option value="Other">Other</option>
</select><td>
</tr>
<tr>
<td><strong>multiple Files Upload </strong></td>
</tr>
<tr>
<td>Select file
<input name="ufile[]" type="file" id="ufile[]" size="50" /></td>
</tr>
<tr>
<td>Select file
<input name="ufile[]" type="file" id="ufile[]" size="50" /></td>
</tr>
<tr>
<td>Select file
<input name="ufile[]" type="file" id="ufile[]" size="50" /></td>
</tr>
<tr>
<td align="center"><input type="submit" name="Submit" value="Upload" /></td>
</tr>
</table>
</td>
</form>
</tr>
</table>
and here is the upload script
<?php
//set where you want to store files
//in this example we keep file in folder upload
//$HTTP_POST_FILES['ufile']['name']; = upload file name
//for example upload file name cartoon.gif . $path will be upload/cartoon.gif
$path1= "upload/".$HTTP_POST_FILES['ufile']['name'][0];
$path2= "upload/".$HTTP_POST_FILES['ufile']['name'][1];
$path3= "upload/".$HTTP_POST_FILES['ufile']['name'][2];
//copy file to where you want to store file
copy($HTTP_POST_FILES['ufile']['tmp_name'][0], $path1);
copy($HTTP_POST_FILES['ufile']['tmp_name'][1], $path2);
copy($HTTP_POST_FILES['ufile']['tmp_name'][2], $path3);
where it says $path1= "upload/".$HTTP_POST_FILES['ufile']['name'][0]; i want it to direct the folder to what ever the value is of the select box. That value will correspond with a directory on the website and then will dump the image there.
For some reason i'm drawing a blank on how to do this so i was hoping for some help.