Dim dotPosition As Integer = filePath.LastIndexOf(“.”)
Dim filenameOnly As String = filePath.Substring(dotPosi
Select Case filenameOnly
Case “zip”
Response.ContentType = “
Case “pdf”
Response.ContentType = “application/pdf”
Case “csv”
Response.ContentType = “application/csv”
Case “doc”
Response.ContentType = “application/doc”
Case “docx”
Response.ContentType = “application/docx”
Case “xls”
Response.ContentType = “application/xls”
Case “xlsx”
Response.ContentType = “application/xlsx”
Case “png”
Response.ContentType = “application/png”
Case “gif”
Response.ContentType = “application/gif”
Case “jpg”
Response.ContentType = “application/jpg”
Case “csv”
Response.ContentType = “application/csv”
Case “txt”
Response.ContentType = “application/txt”
End Select