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. Track how many times my file is downlod

Track how many times my file is downlod

Scheduled Pinned Locked Moved ASP.NET
csharpasp-net
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.
  • F Offline
    F Offline
    farogh haider
    wrote on last edited by
    #1

    Hi, to all I have developed a project with asp.net 2.0. And there is a download link on books, i want to store how many times user download my books.

    H 1 Reply Last reply
    0
    • F farogh haider

      Hi, to all I have developed a project with asp.net 2.0. And there is a download link on books, i want to store how many times user download my books.

      H Offline
      H Offline
      Herman T Instance
      wrote on last edited by
      #2

      What I do is this. My user selects a filename. To download that file hey must press a button-object. In the OnClick Event I Check:

      - Does the file Exist via FileInfo
      FileInfo fi = new FileInfo(DownLoadFileName); // DownLoadFileName = String containing filename
      
      - FileSize larger then 0
      if (fi.Length > 0)
      {
         arrParameter = new SqlParameter[3];
         arrParameter[0] = new SqlParameter("@secUserID", Convert.ToInt32(Session["USERID"]));
         arrParameter[1] = new SqlParameter("@reportName", Page.Title);
         arrParameter[2] = new SqlParameter("@DownloadedFile", txtExcelFile.Text);
      
      // this line stores the collected data in the sqlparameter via a Stoired Procedure into a database table
         SyconosServer.dataBaseActieNonQuery("SE_InsDownload", arrParameter, String.Empty, "SesameNET31");
      
      // Redirect to a common downloadpage so the file is downloadable for the USER
         Response.Redirect(@"~/Export/DownLoadFile.aspx", false);
      }
      

      In Word you can only store 2 bytes. That is why I use Writer.

      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