Jump to content

directory picker in php


qmqmqm

Recommended Posts

Could anyone please advise me how to write a directory (Not File!) picker using php or javascript?

In other words, there should be a button on a webpage, such that when you click it, it shows you a File Manager (I'm using Windows), and lets you pick a directory. Then it records the directory in an html element or a php variable somehow.

 

I searched online but with no luck...

 

Does anyone know how I should go about developing such functionality, or are there already open source ones available?

 

Thanks a lot.

 

Tom

Link to comment
Share on other sites

Create your own ActiveX object.

 

Why do you care to let them browse their own machine? I know I would not like that at all.

 

Hi Premiso, Thanks for your reply.

 

The reason for this is that I need to let them specify a directory which the server is going to read data from.

 

I did find a directory picker using ActiveX:

http://www.tek-tips.com/faqs.cfm?fid=5201

 

However when I tried it on my IE, it says that I must allow the ActiveX control to run.

 

Is there one that does not rely on ActiveX?

 

Thanks,

 

Tom

Link to comment
Share on other sites

Is there one that does not rely on ActiveX?

 

Give the fact that what you want to do could easily effect the user's machine, no. The user has to explicitly allow you access to their machine, which is done by allowing the ActiveX Object. This is done as a security measure.

 

You can keep looking, but chances are you will not find anything more than the ActiveX object that can do this.

Link to comment
Share on other sites

Is there one that does not rely on ActiveX?

 

Give the fact that what you want to do could easily effect the user's machine, no. The user has to explicitly allow you access to their machine, which is done by allowing the ActiveX Object. This is done as a security measure.

 

You can keep looking, but chances are you will not find anything more than the ActiveX object that can do this.

 

So how do webmails allow you to pick a file from your local machine that it will upload and send as email? Isn't it the same idea?

 

The only difference that I can see is that mine is a folder picker, instead of a file picker...

 

Thanks,

 

Tom

Link to comment
Share on other sites

So how do webmails allow you to pick a file from your local machine that it will upload and send as email? Isn't it the same idea?

The only difference that I can see is that mine is a folder picker, instead of a file picker...

 

Not really. Webmails can only see the file. They do not know what directory it comes from. This is true with all uploading forms. None of the know from where that file came, this is a security restriction.

 

Create your own Upload in script in PHP and you may get a better idea of what I am telling you.

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.