Solved

Browse for File Dialog Box

Posted on 2004-03-26
7
1,197 Views
Last Modified: 2012-06-27
hi,

is there a "Browse for File Dialog Box" similar to "Browse for Folder Dialog
Box" in vbs.

i havent found something in microsofts scripthelp

thanks for help

for more details

http://www.experts-exchange.com/Web/Web_Languages/Q_20926583.html

If I got the right answer then you will get total 600
0
Comment
Question by:hasnut
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
7 Comments
 
LVL 33

Expert Comment

by:sajuks
ID: 10694953
// browse for folder script. browse for file, havent seenn one yet
<!doctype html public "-//w3c//dtd html 3.2//en">

<html>

<head>
<SCRIPT LANGUAGE="JavaScript">
<!--
  function fnGetMyPathJ()
  {            
    var oShell = new ActiveXObject("Shell.Application");
                      
    var oFolder = new Object;                              
    oFolder = oShell.BrowseForFolder(0, "Choose a folder", 0);
                                        
    var oFolderItem = new Object;            
    oFolderItem = oFolder.Items().Item();                                                
   
    document.all.item("myPath").innerText = oFolderItem.Path;
  }    
-->
</SCRIPT>


<SCRIPT LANGUAGE="VBScript">
<!--
  function fnGetMyPathVB()
    dim oShell
    dim oFolder
    dim oFolderItem
            
    set oShell = CreateObject("Shell.Application")            
    set oFolder = oShell.BrowseForFolder(0, "Choose a Folder", 0)                    
    set oFolderItem = oFolder.Items.Item            
            
    document.all.item("myPath").innerText = oFolderItem.Path                                
  end function
-->
</SCRIPT>


</head>

<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<INPUT type="button" value="VB" id=button2 name=button2 onClick=fnGetMyPathVB()>
<INPUT type="button" value="JSC" id=button2 name=button2 onClick=fnGetMyPathJ()>

<INPUT type="text" name = "myPath">

</body>

</html>
0
 
LVL 33

Expert Comment

by:sajuks
ID: 10694975
Most Activex security settings dont allow this to run
0
 
LVL 33

Expert Comment

by:sajuks
ID: 10694988

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<script language="JavaScript">
/* File browser (c) 2000 Michel pLungjan */
function goFish(theForm) {
if ( navigator.appName == 'Netscape' && theForm.url.value.indexOf("://",0) == -1 )
  window.open('file://' + theForm.theFile.value, '_self');
else
  window.open(theForm.theFile.value, '_self');
}
</script>
<form NAME="myForm" onSubmit="goFish(this); return false">
<input TYPE="file" NAME="theFile" VALUE size="40">
<input TYPE="submit" VALUE="Go"
</form>



</HTML>
0
 
LVL 1

Author Comment

by:hasnut
ID: 10695012
Hi sajuks,
your first examle only select folder not file,  I need first example that can do both,

You can also give me example dom level that only IE6(not sure) can do.

If you see my other link that I mentioned you will get that same example with folder.


any Ideas?
0
 
LVL 33

Accepted Solution

by:
sajuks earned 500 total points
ID: 10701245
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question