dlebowski Posted August 31, 2007 Share Posted August 31, 2007 What I want to do is allow my users to be able to upload an entire directory worth of images to the server. So for example, the form will ask them for either a file to import or for a directory where the images reside. It will then proceed to upload each image individually until the directory is empyt. Is this possible? Thanks for you help. Ryan Quote Link to comment https://forums.phpfreaks.com/topic/67442-solved-is-it-possible-to-select-a-directory-to-upload-via-php/ Share on other sites More sharing options...
Timma Posted August 31, 2007 Share Posted August 31, 2007 Not so sure about directories, but I'm pretty sure you can let them upload a zip (or other archive) and extract that on your server. http://www.php.net/zip Quote Link to comment https://forums.phpfreaks.com/topic/67442-solved-is-it-possible-to-select-a-directory-to-upload-via-php/#findComment-338558 Share on other sites More sharing options...
dlebowski Posted August 31, 2007 Author Share Posted August 31, 2007 Thanks for the response. I saw that option and that may be my only solution. I really would like them to just be able to select the directory, the contents of the directory are displayed in the page, then the user clicks upload to load them all. That would be ideal. Anyone else with suggestions would be appreciated! Thanks again. Ryan Quote Link to comment https://forums.phpfreaks.com/topic/67442-solved-is-it-possible-to-select-a-directory-to-upload-via-php/#findComment-338561 Share on other sites More sharing options...
Psycho Posted August 31, 2007 Share Posted August 31, 2007 The only way to do it would be with a 3rd party helper program such as ActiveX. There are many available, the good ones cost money. But, this will require the user to downlaod and install the app - something I avoid like the plague with any web sites. OK, a quick search found some flash utilities for doing this. I would consider these since many people will already have flash installed. here is one: http://www.element-it.com/MultiPowUpload.aspx Here's a neat little trick. It requires the user to select files individually, but it is a much cleaner interface than displaying a bunch of file input fields. And it doesn't require any 3rd parth applications. http://the-stickman.com/web-development/javascript/upload-multiple-files-with-a-single-file-element/ Quote Link to comment https://forums.phpfreaks.com/topic/67442-solved-is-it-possible-to-select-a-directory-to-upload-via-php/#findComment-338569 Share on other sites More sharing options...
Timma Posted August 31, 2007 Share Posted August 31, 2007 http://www.radinks.com/upload/folder.php Found this which may help: With PHP handlers You might feel that PHP may not the be the best option because of recent versions of the PHP engine completely removes the path information of uploaded files. With Rad Upload it's quite easy sift the full path through this filter. How do you do it? with the encode_path setting of the applet. The encode_path which was introduced in version 1.31, directs the applet to urlencode the name of each file there by preventing the PHP engine from stripping out path information. It is a simple matter to urldecode them to their original format (with the aid of the PHP urldecode() function). encode_url supersedes the translate_path parameter introduced in version 1.19 rel 2, but you can still make use of translate_path setting if you wish to convert a windows pathname to a unix pathname. In other words to replace all occurrences of the '\' character with the '/' character. Quote Link to comment https://forums.phpfreaks.com/topic/67442-solved-is-it-possible-to-select-a-directory-to-upload-via-php/#findComment-338570 Share on other sites More sharing options...
mitt Posted August 31, 2007 Share Posted August 31, 2007 This is almost what you are looking for except the user still has to select all the files in the folder. This gives a progress of each upload so it helps the user know how far along the process is. http://digitarald.de/project/fancyupload/ Quote Link to comment https://forums.phpfreaks.com/topic/67442-solved-is-it-possible-to-select-a-directory-to-upload-via-php/#findComment-338572 Share on other sites More sharing options...
dlebowski Posted August 31, 2007 Author Share Posted August 31, 2007 Thanks for all your suggestions. I will have a look at these. I just know of a site that uses an ActiveX control to ask you to either select a folder or select a file and it populates a list. You then just click on submit and it pops up a status bar that shows the status of each file as it is being uploaded. It is perfect for what I'm trying to do. Quote Link to comment https://forums.phpfreaks.com/topic/67442-solved-is-it-possible-to-select-a-directory-to-upload-via-php/#findComment-338625 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.