point to a directory

Reply

Join Date: Dec 2007
Posts: 54
Reputation: rouse is an unknown quantity at this point 
Solved Threads: 1
rouse rouse is offline Offline
Junior Poster in Training

point to a directory

 
0
  #1
May 1st, 2009
I want to perform an operation on all files in a given directory. I want the user to choose the directory with some GUI interface.
Using HTML I could use the INPUT as I found in this example below at TIZAG. As anyone found a method just to choose a directory?
Thanks!
WBR

http://www.tizag.com/phpT/fileupload.php
  1. <form enctype="multipart/form-data" action="uploader.php" method="POST">
  2. <input type="hidden" name="MAX_FILE_SIZE" value="100000" />
  3. Choose a file to upload: <input name="uploadedfile" type="file" /><br />
  4. <input type="submit" value="Upload File" />
  5. </form>
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 1,227
Reputation: kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about 
Solved Threads: 167
kkeith29's Avatar
kkeith29 kkeith29 is offline Offline
Nearly a Posting Virtuoso

Re: point to a directory

 
0
  #2
May 1st, 2009
Is there set directories for uploading, or will folders be added/deleted ect?
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 54
Reputation: rouse is an unknown quantity at this point 
Solved Threads: 1
rouse rouse is offline Offline
Junior Poster in Training

Re: point to a directory

 
0
  #3
May 1st, 2009
Folders will be added, but not deleted.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 1,037
Reputation: ardav will become famous soon enough ardav will become famous soon enough 
Solved Threads: 132
ardav's Avatar
ardav ardav is offline Offline
Veteran Poster

Re: point to a directory

 
0
  #4
May 1st, 2009
You want to create folders to upload files to? If so, use a SELECT widget with all the available folders in OPTION tags. Include an INPUT box if you want to create a new upload folder.

The best way to perhaps is to include two radio buttons:

... start form ...

  1. <label for = "oldfolder"><input type = "radio" id="oldfolder" name="folderselect" checked="checked" /> existing folder</label>
  2. <select id="useoldfolder" name="useoldfolder">
  3. <option value="...">...filled from php function to list all folders ...</option>
  4. </select>
  5.  
  6. <label for = "newfolder"><input type = "radio" id="newfolder" name="folderselect" /> new folder</label>
  7. <input type="text" id="addnewfolder" name="addnewfolder" />
... rest of form ...

The destination folder can then be taken from the $_POST variables.

Sorry if this ain't what you're looking for. If it is, you may want to include som client-side (js) validation for folder names (no funny symbols). In addition your server-side validation should check that the folder doesn't already exist. BTW this is a very simple e.g. and will only create 'top-level' document folders, not sub-folders of exisiting document folders. JS can be included to enable/disable the SELECT or INPUT widgets on radio checking.
Happy Humbugging Christmas
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC