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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Response.TransmitFile not working on local network

Response.TransmitFile not working on local network

Scheduled Pinned Locked Moved C#
helpcomsysadmin
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member 3426936
    wrote on last edited by
    #1

    All, This is a strange problem, I tried to find answer without success. The file I am tring to transmit is an xslx file. I have the following piece of code that works fine when our employees/clients access our website from outside our network.

    Response.ContentType = "application/vnd.ms-excel";
    Response.ContentEncoding = System.Text.Encoding.Default;
    Response.AppendHeader("Content-Disposition", "attachment; filename=" + newFile.Name.Replace(" ","_"));
    Response.AddHeader("Content-Length", new System.IO.FileInfo(newFile.FullName).Length.ToString());
    Response.TransmitFile(newFile.FullName);
    HttpContext.Current.ApplicationInstance.CompleteRequest();

    But when someone within our local network/office accesses this website I get the following error, "Unable to download xxxx from xxxx.com. Unable to open this Internet site. The requested site is either unavailable or cannot be found. please try again later." I tried different approaches like adding Response.Flush() and Response.End() etc., nothing worked so far, I appreciate any help with this. This only happens with IE, works fine in Chrome and Firefox, if this helps.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

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