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
  1. Home
  2. Web Development
  3. ASP.NET
  4. Start file download via Code

Start file download via Code

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netsysadminhelpquestion
4 Posts 3 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.
  • L Offline
    L Offline
    Luka Grabarevic
    wrote on last edited by
    #1

    Hi, I have two problems. Problem 1: I have an internal LAN web server which one provides file attachments. I'd like to cache the requestet file on the web server my asp.net site is hosted on. Is it possible to copy an file from one webserver to another via code? Problem 2: Now I'd like to provide the file download for the user. I know, that a direct link is one possiblity, but I'd lik to start the file download via code, too. Is ther any Method or something which handle this? thank in advance regards pdluke

    V N 2 Replies Last reply
    0
    • L Luka Grabarevic

      Hi, I have two problems. Problem 1: I have an internal LAN web server which one provides file attachments. I'd like to cache the requestet file on the web server my asp.net site is hosted on. Is it possible to copy an file from one webserver to another via code? Problem 2: Now I'd like to provide the file download for the user. I know, that a direct link is one possiblity, but I'd lik to start the file download via code, too. Is ther any Method or something which handle this? thank in advance regards pdluke

      V Offline
      V Offline
      Vasudevan Deepak Kumar
      wrote on last edited by
      #2

      pdluke wrote:

      start the file download via code, too.

      Response.WriteFile Also check out this support KB: http://support.microsoft.com/kb/812406[^]

      Vasudevan Deepak Kumar Personal Homepage Tech Gossips

      L 1 Reply Last reply
      0
      • V Vasudevan Deepak Kumar

        pdluke wrote:

        start the file download via code, too.

        Response.WriteFile Also check out this support KB: http://support.microsoft.com/kb/812406[^]

        Vasudevan Deepak Kumar Personal Homepage Tech Gossips

        L Offline
        L Offline
        Luka Grabarevic
        wrote on last edited by
        #3

        Hi, thank for the fast response. I've tried the method from the Microsoft support page, tha you have linked. The Problem is that the exception says, that URI-Fromats can't be handled. regards pdluke

        1 Reply Last reply
        0
        • L Luka Grabarevic

          Hi, I have two problems. Problem 1: I have an internal LAN web server which one provides file attachments. I'd like to cache the requestet file on the web server my asp.net site is hosted on. Is it possible to copy an file from one webserver to another via code? Problem 2: Now I'd like to provide the file download for the user. I know, that a direct link is one possiblity, but I'd lik to start the file download via code, too. Is ther any Method or something which handle this? thank in advance regards pdluke

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          pdluke wrote:

          Is it possible to copy an file from one webserver to another via code?

          I think there is no direct method available. You can do in other way, webserver where files to be copied can request to the file located on this server using WebClient classes DownloadFile() method.

          pdluke wrote:

          Now I'd like to provide the file download for the user. I know, that a direct link is one possiblity, but I'd lik to start the file download via code, too. Is ther any Method or something which handle this?

          Just do Response.Redirect() to the file you want to get downloaded. If file extension is not mapped with any ISAPI module, then browser will prompt Save dialogbox.


          My Website | Ask smart questions

          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