Track how many times my file is downlod
ASP.NET
2
Posts
2
Posters
0
Views
1
Watching
-
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.
-
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.
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.