Starting Download Problem with IIS 6

X

xeroxero

I am attempting to make a small popup window push a downloaded file.
What works fine with the Visual Studio 2005 web server does not appear
to work with IIS6.

My main page code looks like this:

LiteralControl litMove = new LiteralControl();
litMove.Text = @"
<script language='JavaScript'>
<!--
var dlWindow = window.open('theFile', 'fileDl',
'toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=10,left=10,height=24');
//-->
</script>
";
litMove.Text = litMove.Text.Replace( "theFile" , theFile );
this.pageBody.Controls.Add( litMove );



The actual download code (in a new page appearing as "theFile" in the
previous code page above) looks like this:

Response.Clear();
Response.AddHeader( "Content-Disposition" , "attachment;filename=" +
HttpUtility.UrlPathEncode(myFile) );
Response.AddHeader( "Content-Length" , new FileInfo( fullFilePath
).Length.ToString() );
Response.ContentType = "application/octet-stream";
Response.TransmitFile( fullFilePath );
Response.End();

What happens is that on IIS6, the popup appears for 1/2-second and
disappears. On the Visual Studio Cassini server, the window appears
and then the user is prompted for save.

Users are IE7 clients.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,043
Members
48,769
Latest member
Clifft

Latest Threads

Top