5
Reply

Action Link Download - count download in another table

arun sahani

arun sahani

Apr 16 2017 4:40 PM
304
Hi Friends,
I have been struggling for couple of days.(ASP MVC 5 )
I have action link download that download file successfully.
I also want when i click on download action link, i should also get the data inserted in the another table specifying download by, datetime and like that so that I could track the download times.
 
(code and attachment) 
 
  
Your suggestion and help will be hearty appreciated.
Arun Sahani
 
 

ITEM

Name

Details

 

0023

Online books

Asp.net

Download here

0024

Pdf materials

Asp.net MVC

Download here

 

When I click to Action link “Download Here” it redirect to

Action for download as

string file = "~/download_dir/" + attachment;

string contentType = "application/octet-stream";

return File(file, contentType, Path.GetFileName(file));

(Download complete)

Works fine up to here

I want also to insert the data into new table when clicked on above

Download here” action link

Download by (userid)

Download date-time

Details

Download item

Arun1

201704170206

Asp.net

0023

Prina

201704170206

Asp.net MVC

0023

 
 

Attachment: downodff.rar

Answers (5)