Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
R

RT1970

@RT1970
About
Posts
10
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Write Binary Files to the Browser
    R RT1970

    Thanks. I'll try it later

    ASP.NET question

  • Write Binary Files to the Browser
    R RT1970

    I tried this: FileInfo fileInfo = new FileInfo(strPath); Response.AppendHeader("Content-Length", fileInfo.Length.ToString()); Response.AppendHeader("Content-Disposition", string.Format("inline; filename=\"{0}\";", strFile)); and got the same exception.

    ASP.NET question

  • Write Binary Files to the Browser
    R RT1970

    I add this: Response.AppendHeader("Content-Disposition", string.Format("attachment; filename=\"{0}\";", strFile)); Now I can only show file in an independent window, not inside IE, but at least it can show PDF file.

    ASP.NET question

  • Write Binary Files to the Browser
    R RT1970

    At last I found out every time I click that download hyper link, the PDF file did be downloaded and opened in Acrobat Reader, but it’s shown neither in IE or independent Acrobat Reader window. Only when I accidentally opened a PDF file I found Acrobat Reader already opened so many copies of PDF files. I don’t know how to deal with this problem. I may have to ask user to right-click the link and choose Save Target As.

    ASP.NET question

  • Write Binary Files to the Browser
    R RT1970

    Yes, I also heard that though there's an exception, the PDF should shows up without problem. But on my machine it just won't show anything. My OS is Win XP Pro, VS.NET 2003 with framwork ver 1.1 (this may cause the problem). I tried different client - same story. I'll try another server.

    ASP.NET question

  • Write Binary Files to the Browser
    R RT1970

    Yes. I did changed the file permissions. In fact I put all kinds of files (DOC, PPT, PDF...) into one folder and set the security settings for the whole folder.

    ASP.NET question

  • Write Binary Files to the Browser
    R RT1970

    Thanks for your reply. I tried your codes and it turned out to be same. If I don't use Response.End, no exception and works for most file types, but not PDF. The PDF file shows nothing in explorer. If use Response.End, PDF file will make Response.End throw an exception. Some guys suggests just igore the exception, I did it but PDF files won't show up. If I put the file address directly into IE address bar, it works. But I want more control of downloading of the files and prefer binary streem.

    ASP.NET question

  • Write Binary Files to the Browser
    R RT1970

    I tried to write binary files to the browser based on the codes found in Microsoft Knowledge Base Article 306654: //Set the appropriate ContentType. Response.ContentType = "Application/pdf"; //Get the physical path to the file. string FilePath = MapPath("acrobat.pdf"); //Write the file directly to the HTTP content output stream. Response.WriteFile(FilePath); Response.End(); The codes works for many kinds of file types, like DOC, PPT, XLS... but not for PDF. When it's a PDF file, Response.End will throw a ThreadAbortException because "the current response ends prematurely". I also tried BinaryWrite, Flush, no difference. Anyone has any suggestion? Thanks.

    ASP.NET question

  • Help: Dynamically change ASP.NET page title
    R RT1970

    :cool:

    ASP.NET question csharp java asp-net dotnet

  • Help: Dynamically change ASP.NET page title
    R RT1970

    When I use java script in ASP, I can change web page’s title via document.title. How can I do it if I use ASP.NET and I want do it in code behind? Is there something similar to document.title in .NET framework?:confused:

    ASP.NET question csharp java asp-net dotnet
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups