Results 1 to 5 of 5

Thread: VB.Net to open a file download in IE browser directly without asking the end user

  1. #1
    Join Date
    Jan 2009
    Posts
    44

    VB.Net to open a file download in IE browser directly without asking the end user

    I am designing a VB.NET based website

    I have a hyperlink, upon clicking on it a "File Download" prompt opens which asks me whether I want to "Save" the file, "Open" But I want it to directly open in Internet Explorer without showing the prompt....

    How can i do this? It should not show any prompt... when i click on the hyperlink....it should directly open in a new IE window....

    Thanks....

  2. #2
    Join Date
    May 2008
    Posts
    27

    Re: VB.Net to open a file download in IE browser directly without asking the end user

    What kind of the file is that you want to open in client browser?
    IE will only trust certain recognised files not the .exe or .vbs etc.
    You might be able to use the content-disposition: inline header, along with the content-type header.

    I hope this makes you understand the concept.

  3. #3
    Join Date
    Jan 2009
    Posts
    44

    Re: VB.Net to open a file download in IE browser directly without asking the end user

    Well thanks!
    I dot want to open such files in client browser. My file is MS EXCEL file & I want the user to only view it not edit , save or anything. Only for viewing purpose without asking user. I want this file to be open with a new window by hyperlink.
    I think this makes the picture clear.

  4. #4
    Join Date
    Jan 2009
    Posts
    18

    Re: VB.Net to open a file download in IE browser directly without asking the end user

    Hi Kiran I want this same thing but with asp.net
    Is this possible? Since my file is VBS file.
    Please guide me someone.
    My code is :

    Code:
    <%@language="vbscript" %>
    
    <% dim a
    
    a=request.form("sometextbox")
    if a="" then
    %>
    <html>
    <body>
    
    --------some code -------
    </body>
    </html>
    
    <%
    else
    response.redirect("file.vbs")
    end if
    %>
    I want user to run application without asking open, save or run etc. Or any interface for & by user in this case.

    Please help.

  5. #5
    Join Date
    May 2008
    Posts
    2,012

    Re: VB.Net to open a file download in IE browser directly without asking the end user

    The problem you face is that you have to get your web server to process the VB code in the file, before serving the resulting HTML code back to the user (exactly the same as an ASP file) Or else you will end up with your user viewing all of your lovely VB code in their browser.

    Do this:

    1. Go into Internet Information Services.
    2. Right-click on the website serving the VBS file and click Properties.
    3. Select the Home Directory tab, and down the bottom, click Configuration.
    4. Click Add
    5. In Extension, type "vbs" (without the quotes), and in Executable, type C:\Windows\system32\inetsrv\asp.dll
    Your server will now process VBS files in the same manner as ASP files, and should process as normal.
    rename your file to a file extension of ".asp"!

Similar Threads

  1. Good web browser to download youtube files directly
    By Haraksa in forum Technology & Internet
    Replies: 4
    Last Post: 30-07-2013, 01:29 PM
  2. My web browser fails to open download.microsoft com
    By OverTaker in forum Technology & Internet
    Replies: 3
    Last Post: 21-02-2011, 07:51 AM
  3. Replies: 4
    Last Post: 07-02-2011, 10:19 AM
  4. The requested operation cannot be performed on a file with a user-mappedsection open.
    By richard_shaddinger@harte-hanks.com in forum Windows Server Help
    Replies: 9
    Last Post: 20-07-2008, 11:50 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,047,212.97654 seconds with 17 queries