File Open Dialog Box through JavaScript

Hello,

I want to call File Open Dialog Box on a Hyperlink Click, for Attachment of File as you can see this functionality in GMAIL for Attachment of Files.

Regards
Amrat Nandlal

curiously enough this works with IE …

<input type="file" style="display:none;" id="inputfile"/>
<a href="javascript:document.getElementById('inputfile').click(); ">try this</a>

You could also do something like this:

On your “Main page” insert this code


<script type="text/javascript">

        function UploadWindow(URL) {

                 var Upload = window.open(URL,"",

"toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=430,height=50");

        }

</script>

<A HREF="javascript:UploadWindow('UploadWindow.html')">Click here to attach file:</A>

Copy/Paste the following code and save it as UploadWindow.html


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Upload Page</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF" text="#000000">

Select file to upload:
<INPUT type="file" size="50" name="FileName">

</BODY>
</HTML>

I was wondering how Gmail did it in IE. Of course it doesn’t do this in Firefox… Then it becomes simple and plain. Thx for the input.