Protected Sub btnDisplayPassport_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDisplayPassport.Click If Not FileUpload1.HasFile Then Label1.Text = "You have not uploaded a file." ElseIf CheckExtension(FileUpload1.FileName) = False Then Label1.Text = "Only .gifs, and .jpgs, please." Else Session("strUploadedFile") = Server.MapPath("~/images/") & FileUpload1.FileName Image2.Visible = True Try FileUpload1.SaveAs(Server.MapPath("~/images/") & FileUpload1.FileName) Session("sstrPassportFile") = FileUpload1.FileName Label1.Text = FileUpload1.FileName Dim strServerpath As String strServerpath = Server.MapPath("~/images/") Image2.ImageUrl = "thumbnailer.ashx?file=" & Server.UrlEncode(FileUpload1.FileName) Catch exc As Exception Label1.Text = "There was a problem: " & exc.Message End Try End If End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)