![]() |
![]() |
||||||
|
|||||||
| Tags: choice, destination, folder, upload |
![]() |
|
|||
|
Hi,
I have an upload form that works fine. However, I have to determine the destination folder where the files are uploaded to. However, for Housekeeping purposes, instead of a folder containing hundreds of files, it would be practical to create subfolders to filter the files. At the moment I need 6 folders to place the files into. Would it be simpler to create six separate upload forms to each folder, or is it possible to provide to the user the 6 folders which they can choose? Cheers |
| Sponsored Links |
|
|||
|
Hi,
You can use an IF statement to either send to a folder, but you will need to specify what type of image should go to which folder. If you are trying to separate file types or sizes or just random this can work perfectly. Or you can have 6 forms and then only show the extra ones if the "add more" button is clicked. if (isset($_POST['Submit'])) { - - - show form 2 - - - } |
|
|||
|
Hi,
I spent the week-end pondering this issue as I felt there had to be a way to do this simply. I worked it out at 5.am this morning................. The upload form: I called it uploadfiles.php as a test. <form action="uploadedtofolder.php" method="post" ENCTYPE="multipart/form-data"> <table width="80%"> <tr> <td>File: <input type="file" name="file" size="30"></td> <td>Instruction here</td> </tr> <tr> <td>Choose Folder: <select name="folder"> <option value="option1">folderA <option> <option value="option2">folderB <option> <option value="option3">folderC <option> <option value="option4">folderD <option> <option value="option5">folderE <option> </select></td> <td>Instruction</td> </tr> <tr> <td><input type="submit" value="Upload!"></td> <td>Press Upload.</td> </tr> </table> </form> The uploadedtofolder.php page: <?php $folder_name = $_POST["folder"] ; switch ($folder_name) { case "option1": $uploaddir = "folderA/"; //Relevant path of the Folder break; case "option2": $uploaddir = ""folderB/"; break; case "option3": $uploaddir = "folderC/"; break; case "option4": $uploaddir = "folderD/"; break; case "option5": $uploaddir = "folderE/"; break; } echo $uploaddir; if(is_uploaded_file($_FILES['file']['tmp_name'])) { move_uploaded_file($_FILES['file']['tmp_name'],$uploaddir.'/'.$_FILES['file']['n ame']); } print "Your File has been uploaded to the correct Folder!"; ?> This has worked a treat! |
|
|||
|
Hi,
Good question, but the site is being built for a specific purpose. The Upload page will be behind a login page. There are only a handful of people that will acess this. This is a training Portal site that I wanted to clean up, as over the years powerpoint and documents were dumped all over the place. Only a few Trainers will be accessing the upload, and they are responsible for each "Folder". So unless they place the presentations into the correct folder, they will be not be displayed. This is linked to another Forum thread based on Tabbed pages with Spry and MySQL data. I have gotten around this by creating a pure CSS based Tab stucture which now allows me to populate the tab content with direct PHP MySQL Data. So I am killing two birds with the one stone here! Each tab has a Recordset filtered to look for two sets of criteria, The Tab Name, ie Product Family and also Product Sub Group. After Uploading the file, the user then goes to a Form to add a Record to the database and they choose from a few dropdown options, where they must choose their own Family Name and Sub Group and the Powerpoint name as art of the input form. The record will only be displayed in the correct tab and in the correct subcategory, if they have correctly added the presentation into the correct folder and put in the correct Powerpoint name as it will be linked to on the page. I hope this is making sense. It does by now make sense to me. There will be specific instuctions on the pages to do this correctly. I am coding this now so that on the front end, it looks smooth, simple and straight forward, which testing today is working fine. So to answer your query, based on this site, it is in the interest of the trainer to choose their relevent folder :} I hope this makes sense, but I think the folder option is a great breakthrough and I hope people will find a use for it somehow. (Nearly caused a Divorce but hey...) |
|
|||
|
Hi,
Funny enough, as I create Elearning Modules for the company, I have gathered a large arsenal of programs over the years, sometimes just to do one off jobs. I have used a program called Print Screen by a company called American systems, which does exactly that. You tell it where you want the file stored, what format etc, dedicate a shortcut key to it, and everytime you hit the Print Screen button, it auto saves it to that directory. http://www.americansys.com/ps.htm Not usre if it is what you are looking for but it did that for me. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise