Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2005

Tip: Looking for answers? Try searching our database.

Download file returning 0 K Byte with http: but with Physical path

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Khan S - 25 Aug 2005 20:22 GMT
private void Button1_Click(object sender, System.EventArgs e)
        {

Context.Response.Clear();
Context.Response.ContentType = "application/octet-stream";
Context.Response.AppendHeader("accept-ranges", "bytes");
Context.Response.AddHeader("Content-Disposition", "attachment; filename=" +
"test.zip");
Context.Response.BufferOutput = false;
           
Context.Response.Flush();
Context.Response.TransmitFile("c:\\test.zip");

when I use the Physical path it save the file succeesfully in the
destination folder
but when I replace the above Physical path line with the below virtual path
line it dowload the file successfully but with 0 KByte.

Context.Response.TransmitFile("http://test.com/Client/test.zip");

       
            //Context.Response.
        }
    }
}
Signature

khanS

Cowboy (Gregory A. Beamer) - MVP - 26 Aug 2005 14:46 GMT
Use MapPath to get the physical path of the location you wish to save the
file at. You can then save to that path and use a relative path to display
the file.

Signature

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

> private void Button1_Click(object sender, System.EventArgs e)
>         {
[quoted text clipped - 21 lines]
>     }
> }

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.