ASP.NET Web Controls >> Button to launch the "File Open" dialog

by Mr Gordonz » Sat, 16 Aug 2003 01:18:58 GMT

Hi all,

This is actually a repost of a question posted on
microsoft.public.dotnet.framework.aspnet. I have posted it to this
newsgroup because I am hoping that some webcontrol guru will have the answer
to my question.

I want to put a button on a page, and when the user clicks it, the standard
Windows "Open File" dialogue box opens, and the user can browse/select a
file on their PC. Having selected a file, the user clicks Open, and I then
want to capture the file path and name in a string variable. Finally, I
want to upload the file to the server.

BUT: I don't want to use an <input type="file"> control. I know how to do
it with an input control. If possible, I really want to accomplish this
WITHOUT using an input control.

Can this be done? I am beginning to think the answer is no - but I would
love someone to prove me wrong!

Cheers,

MG



Similar Threads

1. Button to launch the "File Open" dialog - ASP.NET Security

2. Button to launch "Open File" Dialogue

Hi all,

I want to put a button on a page, and when the user clicks it, the standard
Windows "Open File" dialogue box opens, and the user can browse/select a
file on their PC.  Having selected a file, the user clicks Open, and I then
want to capture the file path and name in a string variable.  Finally, I
want to upload the file to the server.

BUT:  I don't want to use an <input type="file"> control.

Can this be done?

Cheers,

MG


3. Open some dialog boxes and the mouse cursor moves to one of the dialog buttons - VB.Net

4. File Open and Save dialog poping up while opening PDF

I am trying to display a PDF file (which I am being passed from a web
service as a binary stream) in a browser, but I am being prompted to
save the file instead.  I don't want the user to be prompted; I just
want the PDF to be displayed.  Here is the code:

            Byte binaryData;

            binarydata = GetDataHere();
            Response.ContentType = "application/pdf";
            Response.BinaryWrite(binaryData);
            Response.End()

Note: I am using window.open()(java script) to open the PDF in new
window.

I'm using ASP.NET.  

Thanks in advance.

Satya.

5. Force Open .OFT file in Outlook do not show File Download Dialog - Asp.Net

6. Open File Dialog not shows My Documnets, Pogram Files folders

Hi,
        I have placed Open File Dialog control in my application but when 
its pop up in Folder list it shows only,

"All Folders"
"Business"
"My Music"
"Personal"
"Templates"

but it shows me folders like My Documents or hierarchy like
Program Files->MY App Folder or Windows Folder
and when i select "All Folders" from the folder selection it dont shows me 
files belongs to the My Documents folder.

what i am doing wrong here? cuz i havent seen any option for All types of 
files like *.* to enter.

any suggestion any tips will be appreciated
thanx in advance

7. Open file dialog with strange file name - CSharp/C#

8. Button click on Web Dialog opens its copy in new window

I have an aspx page which I open using the following code fragment below.
The modal web dialog has 2 buttons and whenever I click any of them, a new
window
containing my web dialog form is opened prior to getting to OnClick event
logic
of the buttons. The buttons are part of a user control placed on the form.

How can I get rid of the new window being launched?

Private Sub cmdFacet_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdFacet.Click

    Dim strScript As String

    strScript = "<SCRIPT language='javascript'>" & vbCrLf

    strScript += "window.showModalDialog
('frmFacet.aspx',window,'center=yes;dialogHeight=180px;dialogWidth=400px;hel
p=no;status=no;resizable=no');" & vbCrLf

    strScript += "</SCRIPT>"

    Page.RegisterStartupScript("frmFacetOpen", strScript)

End Sub