My apologies if I've missed any applicable answers during my search.
My asp.net website sends user A an email with a link. Trustwave adds some wrapper information around the link before delivering the email. The user clicks the link, authenticates, and is taken to applicable content. If user A navigates to docs.aspx, selects a PDF, and downloads, PDF is corrupt when user A opens the PDF. The site doesn't create the PDF, it was uploaded by user B.
But, if user A manually browses to site, authenticates, navigates to docs.aspx, and downloads the PDF, it isn't corrupt. Both cases use the same authentication, doc.aspx, code-behind, and PDF.
Stepping through the code is difficult because I don't know how to generate the (Trustwave-protected) email link in my test environment.
Can you suggest additional ways to troubleshoot this? A PNG file worked in both cases, but I don't want to limit the file types user B can upload. The PDF file size is 11 KB, and I'm using an up-to-date Chrome web browser. Simple detailed answers and examples are appreciated.
Here is the doc.aspx method:
For Each i As ListItem In Me.FileListbox.Items
If i.Selected Then
Response.Clear()
Response.AppendHeader("Content-Disposition", "attachment; filename=" & i.Text)
DownloadFile = Server.MapPath("documents") & i.Text
Select Case Right(i.Text, 3)
Case "doc"
Response.ContentType = "application/msword"
Case "jpg"
Response.ContentType = "image/jpeg"
Case "pdf"
Response.ContentType = "application/pdf"
Case "png"
Response.ContentType = "image/png"
Case "xls"
Response.ContentType = "application/vnd.ms-excel"
Case "zip"
Response.ContentType = "application/zip"
Case Else
Response.ContentType = "application/octet-stream"
End Select
Response.TransmitFile(DownloadFile)
Response.End()
End If
Next