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. Problem with file download link

Problem with file download link

Scheduled Pinned Locked Moved ASP.NET
helpsysadminhosting
2 Posts 2 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.
  • P Offline
    P Offline
    pradeep kumarappagari
    wrote on last edited by
    #1

    Hi All, I have a download now button on aspx page, by clicking it need to prompt user to save the file which a movie file at server. i am using following code....

    string path = Server.MapPath("Movie/movie.zip");

        System.IO.FileInfo file = new System.IO.FileInfo(path);
    
        if (file.Exists)
        {
            Response.Clear();
    
            Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
    
            Response.AddHeader("Content-Length", file.Length.ToString());
    
            Response.ContentType = "application/zip";
    
            Response.WriteFile(file.FullName);
    
            Response.End();
          }
    

    this code is working fine in local system...but giving problem when i upload it in to my hosting server. Please help me regrading this.

    Pradeep Reddy

    R 1 Reply Last reply
    0
    • P pradeep kumarappagari

      Hi All, I have a download now button on aspx page, by clicking it need to prompt user to save the file which a movie file at server. i am using following code....

      string path = Server.MapPath("Movie/movie.zip");

          System.IO.FileInfo file = new System.IO.FileInfo(path);
      
          if (file.Exists)
          {
              Response.Clear();
      
              Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
      
              Response.AddHeader("Content-Length", file.Length.ToString());
      
              Response.ContentType = "application/zip";
      
              Response.WriteFile(file.FullName);
      
              Response.End();
            }
      

      this code is working fine in local system...but giving problem when i upload it in to my hosting server. Please help me regrading this.

      Pradeep Reddy

      R Offline
      R Offline
      Rinki Mukheraji
      wrote on last edited by
      #2

      when u load movie on hosting server. which folder store this movie. full security of conrol that folder.

      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