Jump to content

[SOLVED] Is it possible to select a directory to upload via .php?


dlebowski

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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/

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.