Hi Thom,
Thanks for your response.
So since the file is on remote site, if you directly redirect the client to
that server's url, the security restriction of the site on client will be
different from your local site which will also cause the unexpected
problem.... Is that remote server in your own local environment (domain
or subnet...) or can you use Remote File Share(like
\\servername\shareddir\......) to visit those files instead of HTTP url
link? As I mentioned before, use the code programmatically write out file
stream we can retrieve file from different source (database, local file,
remote file share ...... ). So if possible, you can consider put those
remote files in a remote file share so that our asp.net application can
read remote file share to retrieve the file stream and write to client...
Also, we can also consider just programmatically copy those file to local
first and write out the files from local disk place.....
How do you think ?
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Thom Little" <th**@tlanet.net>
| References: <#W**************@TK2MSFTNGP14.phx.gbl>
<8l**************@TK2MSFTNGXA02.phx.gbl>
<un**************@TK2MSFTNGP12.phx.gbl>
<A1*************@TK2MSFTNGXA02.phx.gbl>
| Subject: Re: AxWebBrowser Downloads
| Date: Tue, 27 Dec 2005 03:18:00 -0500
| Lines: 233
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| Message-ID: <eK**************@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 65.99.185.176
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP10.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:367116
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I tried the approach that you suggested ...
|
| Unfortunately the way I was doing it allowed me to download the files
from a
| server different from the server with the ASP.NET code. Your approach
| requires the files to be on the same server.
|
| Conversely ... your approach works correctly for both .msi and .zip on
four
| systems running Windows Server 2003, Windows XP, and Windows 2000.
|
| Some Bits!
|
| I will live with the restriction.
|
| Mine is ...
|
| Response.Clear( );
| Response.ClearContent( );
| Response.ContentType = "application/octet-stream" ;
| Response.AddHeader("content-disposition", "attachment; filename=" +
| strURL );
| Response.WriteFile( Server.MapPath( "./" + strURL ) );
| Response.End( );
|
| Thanks for the help.
|
| --
| -- Thom Little --
www.tlanet.net -- Thom Little Associates, Ltd.
| --
|
| "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
| news:A1*************@TK2MSFTNGXA02.phx.gbl...
| > Hi Thom,
| >
| > I'm afraid for web application since it is restricted in the clientside
| > browser's sandbox, we can not get rid of the clientside security
| > restriction. BTW, you mentioned, that in your web page you just use
| > Response.Redirect to redirect the request to the file you want to
| > download?
| > I'd suggest you try using the following code which programmatically
write
| > the file stream to the response output stream that'll be more flexible
| > than
| > using Respons.Redirect
| >
| > ===============
| > Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
| > System.EventArgs) Handles Button1.Click
| >
| > Response.Clear()
| > Response.ClearContent()
| >
| > Response.ContentType = "application/octet-stream"
| > Response.AddHeader("content-disposition", "attachment;
| > filename=test.zip")
| >
| > Response.WriteFile(Server.MapPath("./test.zip"))
| >
| > Response.End()
| > End Sub
| > ================
| >
| > Also, you can also changed to retrieve the file stream from database ,
| > remote folder ..... And the
| >
| > Response.AddHeader("content-disposition", "attachment;
filename=test.zip")
| >
| > statement will force the clientside always try open or save the file
| > stream
| > as download.... You can have a try on this to see whether it works...
| > Based on my local test, the output file can be correctly download and
| > saved....
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure!
www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| > --------------------
| > | From: "Thom Little" <th**@tlanet.net>
| > | References: <#W**************@TK2MSFTNGP14.phx.gbl>
| > <8l**************@TK2MSFTNGXA02.phx.gbl>
| > | Subject: Re: AxWebBrowser Downloads
| > | Date: Mon, 26 Dec 2005 12:58:34 -0500
| > | Lines: 111
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| > | X-RFC2646: Format=Flowed; Original
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| > | Message-ID: <un**************@TK2MSFTNGP12.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: 65.99.185.176
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:367077
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Thank you for the information.
| > |
| > | This application is intended to be open to the public.
| > |
| > | Is there a recommend technique for an application like this one that
is
| > not
| > | dependent on the IE settings on the client? Other applications seem
to
| > be
| > | doing something of this type.
| > |
| > | --
| > | -- Thom Little --
www.tlanet.net -- Thom Little Associates, Ltd.
| > | --
| > |
| > | "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
| > | news:8l****************@TK2MSFTNGXA02.phx.gbl...
| > | > Hi Thom,
| > | >
| > | > Welcome to ASPNET newsgroup.
| > | > From the description, you're encountering some file blocking issue
| > when
| > | > try
| > | > using IE or webbrowser control to download msi or zip files from an
| > | > ASP.NET
| > | > page....
| > | >
| > | > for such blocking behavior, based on my experience, it is likely
due
| > to
| > | > the
| > | > client side IE's security setting. The IE by default will blocking
| > some
| > | > files( which is considered unsafe)'s downloading ... And MSI is
| > generally
| > | > considered as such unsafe file (also some other activex control's
CAB
| > | > package... or unsafe script components....). For zip I think it
| > should
| > be
| > | > a machine specific behavior since zip file is not by default
included
| > in
| > | > the IE's unsafe file list.... You can first check the IE's
security
| > | > setting for internet zone about file or component downloading,
through
| > the
| > | > following path:
| > | >
| > | > Internet Options--->Security ---->Internet zone ------>custom
| > level.....
| > | >
| > | > And the following article has described the unsafe file list for IE:
| > | >
| > | > #Information About the Unsafe File List in Internet Explorer 6
| > | >
http://support.microsoft.com/kb/2913...23120121120120
| > | >
| > | > Also, for some more detailed IE configuration info, you can consider
| > | > posting in IE related newsgroup to get some further information...
| > | >
| > | > Hope helps. Thanks,
| > | >
| > | > Steven Cheng
| > | > Microsoft Online Support
| > | >
| > | > Get Secure!
www.microsoft.com/security
| > | > (This posting is provided "AS IS", with no warranties, and confers
no
| > | > rights.)
| > | >
| > | >
| > | >
| > | >
| > | >
| > | >
| > | > --------------------
| > | > | From: "Thom Little" <th**@tlanet.net>
| > | > | Subject: AxWebBrowser Downloads
| > | > | Date: Mon, 26 Dec 2005 02:30:25 -0500
| > | > | Lines: 24
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| > | > | X-RFC2646: Format=Flowed; Original
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| > | > | Message-ID: <#W**************@TK2MSFTNGP14.phx.gbl>
| > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | > | NNTP-Posting-Host: 65.99.185.176
| > | > | Path:
| > TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP14.phx.gbl
| > | > | Xref: TK2MSFTNGXA02.phx.gbl
| > | > microsoft.public.dotnet.framework.aspnet:367026
| > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > | > |
| > | > | I have a windows application that has an update form that uses
| > | > AxWebBrowser
| > | > | to connect to a distribution site. This site uses a
| > Response.Redirect
| > | > to
| > | > | download of either a .msi file or a .zip file.
| > | > |
| > | > | I have tried this under four systems Windows XP, Windows 2000,
| > Server
| > | > 2003
| > | > | with mixed results. Sometimes the .msi file is blocked.
Sometime
| > the
| > | > zip
| > | > | file is blocked. Sometimes both are blocked. Sometimes neither
is
| > | > blocked.
| > | > |
| > | > | If the distribution site is accessed directly from a browser then
it
| > | > also
| > | > | gets a mixture of results from system to system.
| > | > |
| > | > | Is there a recommended approach for downloading .msi and .zip
files
| > that
| > | > | will ALWAYS work and that will not be prone to how the browser is
| > | > configured
| > | > | on the client machine? (The client's firewall configuration is
| > there
| > | > | responsibility.)
| > | > |
| > | > | What was the source of your information?
| > | > |
| > | > | --
| > | > | -- Thom Little --
www.tlanet.net -- Thom Little Associates,
| > Ltd.
| > | > | --
| > | > |
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|