| | |
point to a directory
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Dec 2007
Posts: 54
Reputation:
Solved Threads: 1
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
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
PHP Syntax (Toggle Plain Text)
<form enctype="multipart/form-data" action="uploader.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Choose a file to upload: <input name="uploadedfile" type="file" /><br /> <input type="submit" value="Upload File" /> </form>
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 ...
... 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.
The best way to perhaps is to include two radio buttons:
... start form ...
PHP Syntax (Toggle Plain Text)
<label for = "oldfolder"><input type = "radio" id="oldfolder" name="folderselect" checked="checked" /> existing folder</label> <select id="useoldfolder" name="useoldfolder"> <option value="...">...filled from php function to list all folders ...</option> </select> <label for = "newfolder"><input type = "radio" id="newfolder" name="folderselect" /> new folder</label> <input type="text" id="addnewfolder" name="addnewfolder" />
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
![]() |
Similar Threads
- EXPLORER.EXE - Entry Point Not Found (Windows NT / 2000 / XP)
- 100 manual directory submissions, in a month--too many? (Search Engine Optimization)
- how to sort out 'active directory cannot be found in cache' error (Visual Basic 4 / 5 / 6)
- ASP.Net Directory Problems (ASP.NET)
- Where does the Active Directory know to find.. (Windows NT / 2000 / XP)
- Connecting to a LAN with a Loopback adapter (Networking Hardware Configuration)
- Started with Frontpage now want Dreamweaver (Site Layout and Usability)
- The procedure entry point DdEntry1 could not be located in the dynamic link library G (Windows NT / 2000 / XP)
- IIS - Vitrual Directory (Windows NT / 2000 / XP)
- e-directory removal (Novell)
Other Threads in the PHP Forum
- Previous Thread: Dynamic pdf generated by php
- Next Thread: PHP+mysql URl opening problem
| Thread Tools | Search this Thread |
.htaccess ajax apache api array beginner binary body broken cakephp checkbox class cms code cron curl database date date/time directory display download dynamic echo email error file files folder form forms function functions global google href htaccess html image include insert integration ip java javascript joomla limit link list login loop mail menu mlm mod_rewrite msqli_multi_query multiple mycodeisbad mysql oop parameter paypal pdf php problem query radio random recourse recursion regex registrationform remote script search seo server sessions sms soap source space sql static syntax system table tutorial update upload url validation validator variable video web webdesign wordpress xml youtube






