944,028 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 11796
  • PHP RSS
Jul 19th, 2006
0

browse directory window

Expand Post »
I've got a problem. I'm writing an input form that takes a file name from the user. i want to put a button next to the text box that will open up windows explorer to ensure that there are no typos in the path. does anyone have an idea as to how i can accomplish this?

thanks in advance.
Last edited by donkey; Jul 19th, 2006 at 3:56 pm.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
donkey is offline Offline
14 posts
since Jul 2006
Jul 19th, 2006
0

Re: browse directory window

Quote originally posted by donkey ...
I've got a problem. I'm writing an input form that takes a file name from the user. i want to put a button next to the text box that will open up windows explorer to ensure that there are no typos in the path. does anyone have an idea as to how i can accomplish this?

thanks in advance.
Insert the following lines into your form
[html]
<input name="userfile" type="file"> <input value="Submit" type="submit" value="DoAnything"/>
[/html]

I believe that's what you need
Reputation Points: 10
Solved Threads: 0
Newbie Poster
vov4ik is offline Offline
16 posts
since Jul 2006
Jul 19th, 2006
0

Re: browse directory window

that is perfect, just one more question is there a way to tell it where to display. right now it starts at the level that the form is saved in. is there a way to start it at the root?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
donkey is offline Offline
14 posts
since Jul 2006
Jul 20th, 2006
0

Re: browse directory window

Quote originally posted by donkey ...
that is perfect, just one more question is there a way to tell it where to display. right now it starts at the level that the form is saved in. is there a way to start it at the root?
I'm not sure whether such option exists in html. I have the same question
Reputation Points: 10
Solved Threads: 0
Newbie Poster
vov4ik is offline Offline
16 posts
since Jul 2006
Jul 20th, 2006
0

Re: browse directory window

Quote originally posted by donkey ...
that is perfect, just one more question is there a way to tell it where to display. right now it starts at the level that the form is saved in. is there a way to start it at the root?
Do you mean you want to specify which Folder to open up in explorer when a user clicks on the "Browse" button for the File upload form element?

If so, I dont believe this is possible but would like to know if it is. Internet explorer has some file access functions that is availble to javascript (uses ActiveX so requires permission from user) that allows you to build custom file upload boxes i believe. I havent tested this but I've seen it implemented.

For a regular file upload element however, html or javascript cannot access the explorer folders as a security issue. Otherwise you will be able to look into filesystems on remote computers.
The value of the upload form element is read only so you wont be able to set it with JavaScript either.
Moderator
Reputation Points: 457
Solved Threads: 101
Nearly a Posting Virtuoso
digital-ether is offline Offline
1,250 posts
since Sep 2005
Jul 20th, 2006
0

Re: browse directory window

I've done some more research and everything that i've found says that it isn't possible to give explorer a certain folder to open to. i have found, however, an attribute that allows you to filter certain file types.. &quot;accept=&quot;text/html,text/pdf&quot; but when i put that in the input tag it doesn't change anything, i can still see my php files in explorer. Any ideas on how to make this work so that the user cannot see the php files?
Last edited by donkey; Jul 20th, 2006 at 12:10 pm.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
donkey is offline Offline
14 posts
since Jul 2006
Jul 20th, 2006
0

Re: browse directory window

Some browse buttons take suggestions... If you prefill the value in the body then click browse it starts from that point.

It's not consistant, and because of remote code execution possibilities most likely /not/ available in your browser.
Reputation Points: 23
Solved Threads: 23
Posting Pro in Training
Puckdropper is offline Offline
494 posts
since Jul 2004
Jul 25th, 2006
0

Re: browse directory window

ok.. the browse part is working wonderfully, thank you very much. now one more question. I have a modify option on this form where the program reads the data base and displays a certain record. is there a way to fill that text box for the file name with the directory that is stored in the db? i've tried using value= and that does nothing. Is that because of that Security issue? Sorry to be a pain in the ass about this. thanks again!
Last edited by donkey; Jul 25th, 2006 at 4:28 pm.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
donkey is offline Offline
14 posts
since Jul 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: PHP/Mysql
Next Thread in PHP Forum Timeline: Query optimization





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC