1

I want to limit user from downloading the second file if his first file download not finished yet, My approach is to insert a record for downloading file on database with finished attribute equal to false; when download finished I change the finished = true; so the user will able to download another file. for knowing if download finished I created a class named ControlledFileStreamResult derived from FileStreamResult. and a Filter that implements IResultFilter. in this Filter; I implement the OnResultExecuted in a way that control the property values in ControlledFileStreamResult and if DownloadCompleted == true then update database and set finished = true; or if DownloadCanceled == true then remove the record from db.

This approach work well until the user uses Internet Download Manager and similar download manager programs to download the file; OnResultExecuted cannot catch if download canceled. and also when these type of programs used the request sent multiple time so I cannot manage to removing the record from db or set finished=true if download successfully completed.

mesut
  • 2,099
  • 3
  • 23
  • 35
  • Though roughly described, it's an interesting problem. And one I suspect isn't directly solvable in the ASP.NET application itself but rather by means of hooking into the web server instance (IIS probably?) to perform such a restriction. – David Mar 12 '14 at 13:07

0 Answers0