Adobe Dreamweaver Forums



Last 10 THreads :         Re: Unable to authenticate installer (Last Post : D Sparks - Replies : 1 - Views : 2 )           »          Microphone in the latest beta (Last Post : 0x656b694d - Replies : 0 - Views : 1 )           »          Please help me (Last Post : HalfNelson - Replies : 0 - Views : 1 )           »          Re: Fireworks screws up colors from photoshop (Last Post : chirp88 - Replies : 5 - Views : 6 )           »          CFdirectory recurse error (Last Post : Adam Cameron - Replies : 1 - Views : 2 )           »          Coldfusion Login (Last Post : ProjectedSurplus - Replies : 0 - Views : 1 )           »          CFC Path works on dev but not in production (Last Post : Adam Cameron - Replies : 1 - Views : 2 )           »          Application Variables vs Request Variables (Last Post : Adam Cameron - Replies : 22 - Views : 23 )           »          COMPLETELY CONFUSED (Last Post : texjgc - Replies : 10 - Views : 11 )           »          Re: Threads when they are done (Last Post : Adam Cameron - Replies : 1 - Views : 2 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Dreamweaver: Main > Dreamweaver Application Development
 
Tags: , , ,

Reply
  #1 (permalink)  
Old 05-10-2008, 08:53 AM
Macnimation
 
Posts: n/a
Diggs:
Default Choice of Upload destination Folder

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

Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-10-2008, 08:53 AM
The_FedEx_Guy
 
Posts: n/a
Diggs:
Default Re: Choice of Upload destination Folder

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 - - -
}





Reply With Quote
  #3 (permalink)  
Old 05-10-2008, 08:53 AM
Macnimation
 
Posts: n/a
Diggs:
Default Re: Choice of Upload destination Folder

I'll try that.

Cheers
Reply With Quote
  #4 (permalink)  
Old 05-12-2008, 10:41 AM
Macnimation
 
Posts: n/a
Diggs:
Default Re: Choice of Upload destination Folder

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!

Reply With Quote
  #5 (permalink)  
Old 05-12-2008, 10:41 AM
The_FedEx_Guy
 
Posts: n/a
Diggs:
Default Re: Choice of Upload destination Folder

Brilliant mate,
Good work
Reply With Quote
  #6 (permalink)  
Old 05-12-2008, 10:41 AM
The_FedEx_Guy
 
Posts: n/a
Diggs:
Default Re: Choice of Upload destination Folder

One question tho,
Are you going to be using this upload page or your users?
What is to stop them from using folder A all the time? thinking that folder A has higher priority?
Reply With Quote
  #7 (permalink)  
Old 05-13-2008, 05:40 AM
Macnimation
 
Posts: n/a
Diggs:
Default Re: Choice of Upload destination Folder

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...)

Reply With Quote
  #8 (permalink)  
Old 05-13-2008, 05:40 AM
The_FedEx_Guy
 
Posts: n/a
Diggs:
Default Re: Choice of Upload destination Folder

Yes thats make more sense.
I dont suppose you know anything about capturing a screen shot of a page and then having it store on the server?
Reply With Quote
  #9 (permalink)  
Old 05-13-2008, 05:40 AM
Macnimation
 
Posts: n/a
Diggs:
Default Re: Choice of Upload destination Folder

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.


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 10:25 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk