Ask a Question related to ASP.NET General, Design and Development.
-
dsoltesz #1
local file download
I'm trying to download a local file from the server.
Went I get the save dialog box and save the file, its
saving the current aspx page and not the file I
specified. Here is the code I"m using. Any ideas why
this is happening?
Response.ContentType = "application/x-zip-compressed";
System.IO.FileStream downloadFile = new
System.IO.FileStream
(@"C:\\VirtualCafeSourceSafeCode\\Database.zip",
System.IO.FileMode.Open);
long FileSize;
FileSize = downloadFile.Length;
byte[] getContent = new byte[(int)FileSize];
downloadFile.Read(getContent, 0, (int)
downloadFile.Length);
downloadFile.Close();
Response.BinaryWrite(getContent);
dsoltesz Guest
-
Problem with local file and local link
Hi to everybody, I have installed a new version of flash player (9,0,28,0) and when I open a local file like: c:\test\index.html When I click... -
LWP - multipart/form-data file upload from scalar rather than local file
I'm looking to do an HTTP upload, preferably with HTTP::Request::Common, but get the file data from either a filehandle or a scalar rather than... -
Need to download data to local access database
Have a web app (ASP classic) that saves data to an Access database on the web host. Need to come up with some sort of ASP admin tool that will... -
Download binary file to local hard drive
If this is not the appropriate NG, please help me by telling me where I should post this question. I want to keep a collection of Word Documents... -
Protect local data files from download?
Just make sure that the extension of the file is unkown to IIS. Give the file a name like data.xyz or something. Then IIS will never serve it up... -
Kevin Spencer #2
Re: local file download
Are you sure it's saving an aspx page, or is it saving the zip file with the
same name as the aspx page? The second would be expected.
HTH,
Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
[url]http://www.takempis.com[/url]
Big things are made up of
lots of Little things.
"dsoltesz" <dan_soltesz@hotmail.com> wrote in message
news:038001c33f56$cdc430b0$a501280a@phx.gbl...> I'm trying to download a local file from the server.
> Went I get the save dialog box and save the file, its
> saving the current aspx page and not the file I
> specified. Here is the code I"m using. Any ideas why
> this is happening?
>
> Response.ContentType = "application/x-zip-compressed";
> System.IO.FileStream downloadFile = new
> System.IO.FileStream
> (@"C:\\VirtualCafeSourceSafeCode\\Database.zip",
> System.IO.FileMode.Open);
> long FileSize;
> FileSize = downloadFile.Length;
> byte[] getContent = new byte[(int)FileSize];
> downloadFile.Read(getContent, 0, (int)
> downloadFile.Length);
> downloadFile.Close();
> Response.BinaryWrite(getContent);
Kevin Spencer Guest
-
Kevin Spencer #3
Re: local file download
That would do it.
HTH,
Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
[url]http://www.takempis.com[/url]
Big things are made up of
lots of Little things.
"dsoltesz" <dan_soltesz@hotmail.com> wrote in message
news:039e01c33f59$200fc710$a501280a@phx.gbl...> I need to add this line of code in to make it work.
> Response.AddHeader("content-
> disposition", "filename=Database.zip");
>
>> >-----Original Message-----
> >I'm trying to download a local file from the server.
> >Went I get the save dialog box and save the file, its
> >saving the current aspx page and not the file I
> >specified. Here is the code I"m using. Any ideas why
> >this is happening?
> >
> >Response.ContentType = "application/x-zip-compressed";
> >System.IO.FileStream downloadFile = new
> >System.IO.FileStream
> >(@"C:\\VirtualCafeSourceSafeCode\\Database.zip" ,
> >System.IO.FileMode.Open);
> >long FileSize;
> >FileSize = downloadFile.Length;
> >byte[] getContent = new byte[(int)FileSize];
> >downloadFile.Read(getContent, 0, (int)
> >downloadFile.Length);
> >downloadFile.Close();
> >Response.BinaryWrite(getContent);
> >.
> >
Kevin Spencer Guest



Reply With Quote

