다운로드를 제공해야하는대로 작동하는 처리기가 있습니다.ASP.net C# partial get request
// Get size of file
FileInfo f = new FileInfo(Settings.ReleaseFileLocation + ActualFileName);
long FileSize = f.Length;
// Init (returns ID of tblDownloadLog record created with blank end date)
int DownloadRecordID = Constructor.VersionReleaseDownload.newReleaseDownload(ActualFileName);
context.Response.Clear();
context.Response.Buffer = false;
context.Response.ContentType = "application/octet-stream";
context.Response.AddHeader("Content-Disposition", "attachment; filename=" + OriginalFileName);
context.Response.AddHeader("Content-Length", FileSize.ToString());
context.Response.TransmitFile(Settings.ReleaseFileLocation + ActualFileName);
context.Response.Close();
// Complete download log, fills out the end date
Constructor.VersionReleaseDownload.completeReleaseDownload(DownloadRecordID);
context.Response.Close();
는 다운로드가
문제는 우리가 올 로그를 많이 얻고있다 (Only count a download once it's served 재) 매우 유용하다 완료되면 completeReleaseDownload()
만 실행 보장 : 이것은 중요한 코드입니다 같은 시간 간격으로 같은 IP 주소에서. 조금 더 파고 들자면 다운로드 소비자 소프트웨어를 사용하는 사용자 인 것으로 보입니다.
다운로드받는 사람을 사용하려고하면 실패 할 것 같습니다. 내 질문은 :
- 나는 이것이 내가
- 가 어떻게이가)에
https://www.scirra.com/downloads/releases/construct2-r68-setup_4.exe
를 호출 그래서 위의 코드와 함께 작동 할 수있는 부분 요청을 처리 할 수있는 방법 부분 요청 - 입니다 감지 어떻게 첫 번째 부분 수신 및 b) 마지막 부분 수신시
completeReleaseDownload
호출? 이 전자 태그와 마임 달성된다
나는이 질문 http://stackoverflow.com/questions/5429947/supporting-resumable-http-downloads-through-an-ashx-handler에 답을 생각하는 데 도움이 –