Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 07-02-2009
Member
 
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....
Reply With Quote
  #2  
Old 07-02-2009
Member
 
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.
Reply With Quote
  #3  
Old 07-02-2009
Member
 
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.
Reply With Quote
  #4  
Old 07-02-2009
Member
 
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.
Reply With Quote
  #5  
Old 07-02-2009
Member
 
Join Date: May 2008
Posts: 2,008
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"!
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "VB.Net to open a file download in IE browser directly without asking the end user"
Thread Thread Starter Forum Replies Last Post
Good web browser to download youtube files directly Haraksa Technology & Internet 4 30-07-2013 01:29 PM
My web browser fails to open download.microsoft com OverTaker Technology & Internet 3 21-02-2011 07:51 AM
I cannot file ?Confirm open after Download" checkbox for file types in Windows 7 Dalapathi Operating Systems 4 07-02-2011 10:19 AM
The requested operation cannot be performed on a file with a user-mappedsection open. richard_shaddinger@harte-hanks.com Windows Server Help 9 20-07-2008 11:50 PM


All times are GMT +5.5. The time now is 10:12 AM.