Dim path As String
Dim i As Integer
Dim name As String
Dim temp As String
If Not File1.PostedFile Is Nothing Then
path = File1.PostedFile.FileName
i = path.LastIndexOf(".")
name = path.Substring(i)
If name = ".gif" Or name = ".jpg" Or name = "GIF" Or name = "JPG" Then
' If File1.Value <> "" Then
Try
temp = CStr(DateTime.Now.Hour) + CStr(DateTime.Now.Minute) + CStr(DateTime.Now.Second)
File1.PostedFile.SaveAs(Server.MapPath("/bwjcare/photo/" + temp + name))
save(temp, name)
Image1.ImageUrl = "/bwjcare/photo/" + temp + name
Label5.Visible = True
Label6.Visible = True
type.Text = File1.PostedFile.ContentType
size.Text = CStr(Math.Round(File1.PostedFile.ContentLength / 1024)) + "K"
Catch
Response.Write(Image1.ImageUrl)
Response.Write(File1.PostedFile.ContentType)
Response.Write(File1.PostedFile.ContentLength)
End Try