Bitcoin valeur trackid sp 006

Comment

Author: Admin | 2025-04-28

I'm having problem catching the error The remote host closed the connectionon the production server but it is working on my local machine. My code is like thistry{ SqlDataSource_Gift.saveGiftDownloadLogs(guestGuid, guestEmail, couponCode, albumId, trackId, "Downloading"); List result = SqlDataSource_Track.getTrackInfoDetail(trackId); faeTrackInfoDetail item = result.First(); catalogueId = item.CatalogueID; filename = item.DiscNo.ToString() + "." + item.TrackNo.ToString() + " - " + CleanFileName(item.TrackTitle) + "." + mediaType; urlPath = "mydomain.com/Download/DownloadAudioTrack.ashx?id=" + catalogueId + "&trackid=" + trackId + "&ext=" + mediaType; context.Response.ClearContent(); context.Response.ClearHeaders(); if (mediaType != "mp3") { context.Response.ContentType = "application/octet-stream"; } else { context.Response.ContentType = "application/mpeg"; } context.Response.AppendHeader("Content-Disposition", "inline; filename=" + (char)(34) + filename + (char)(34)); context.Response.BufferOutput = false; using (var wc = new WebClient()) { using (var download = wc.OpenRead(urlPath)) { using (var respStream = context.Response.OutputStream) { download.CopyTo(respStream); SqlDataSource_Gift.saveGiftDownloadLogs(guestGuid, guestEmail, couponCode, albumId, trackId, "Downloaded"); } } }}catch (Exception ex){ string exceptionMessage = ex.Message; if (exceptionMessage.ToLower().Contains("the remote host closed the connection.")) { // Download Cancelled! SqlDataSource_Gift.saveGiftDownloadLogs(guestGuid, guestEmail, couponCode, albumId, trackId, "Cancelled"); } else { // Download Error! SqlDataSource_Gift.saveGiftDownloadLogs(guestGuid, guestEmail, couponCode, albumId, trackId, "Error"); }}I need to know when the user cancelled the downloading and log it to the database. Right now it is not working when the code is deployed to prod server but working when I'm debugging. Is there a settings in IIS that I need to check. Thanks in advance.

Add Comment