qmqmqm Posted March 9, 2009 Share Posted March 9, 2009 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 Quote Link to comment Share on other sites More sharing options...
Mchl Posted March 9, 2009 Share Posted March 9, 2009 I'm wondering if JavaScript security restraints would actually allow that... Just wondering, no idea... Quote Link to comment Share on other sites More sharing options...
phper100001 Posted March 9, 2009 Share Posted March 9, 2009 **POST MODIFED** Misread original message my post was irrelevant sorry. Quote Link to comment Share on other sites More sharing options...
qmqmqm Posted March 10, 2009 Author Share Posted March 10, 2009 does anyone have any ideas on how to do this? Quote Link to comment Share on other sites More sharing options...
premiso Posted March 10, 2009 Share Posted March 10, 2009 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. Quote Link to comment Share on other sites More sharing options...
qmqmqm Posted March 10, 2009 Author Share Posted March 10, 2009 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 Quote Link to comment Share on other sites More sharing options...
premiso Posted March 10, 2009 Share Posted March 10, 2009 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. Quote Link to comment Share on other sites More sharing options...
qmqmqm Posted March 10, 2009 Author Share Posted March 10, 2009 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 Quote Link to comment Share on other sites More sharing options...
premiso Posted March 10, 2009 Share Posted March 10, 2009 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. Quote Link to comment Share on other sites More sharing options...
Mchl Posted March 10, 2009 Share Posted March 10, 2009 How do you expect to make server READ anything from user's computer? Quote Link to comment Share on other sites More sharing options...
qmqmqm Posted March 10, 2009 Author Share Posted March 10, 2009 How do you expect to make server READ anything from user's computer? I plan to use PEAR::HTTP_Upload library Quote Link to comment Share on other sites More sharing options...
Mchl Posted March 10, 2009 Share Posted March 10, 2009 Ok. This makes sense. Although strictly speaking it is still uploading to a server. Quote Link to comment 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.