Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Browse for File Dialog Box

Posted on 2004-03-26
7
Medium Priority
?
1,200 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 2000 total points
ID: 10701245
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
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…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

610 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