M
Mark
Hello All
I have a problem with this code here
Dim strFileName As String = txtFile.PostedFile.FileName.Trim
Try
If txtFile.PostedFile.ContentType.ToString = "image/pjpeg" Then
' strFileName = txtFile.PostedFile.FileName.Trim()
strFileName = Path.GetFileName(strFileName)
strFileName = Server.MapPath("images") & "\" & strFileName
txtFile.PostedFile.SaveAs(strFileName)
'RaiseEvent UploadComplete()
Else
lblMessage.Visible = True
lblMessage.Text = "File type MUST be in jpeg(jpg) format."
End If
Catch ex As Exception
Me.Visible = False
Response.Write(ex.Message)
End Try
I get an access denied on the strfilename. Any ideas?
Thanks
I have a problem with this code here
Dim strFileName As String = txtFile.PostedFile.FileName.Trim
Try
If txtFile.PostedFile.ContentType.ToString = "image/pjpeg" Then
' strFileName = txtFile.PostedFile.FileName.Trim()
strFileName = Path.GetFileName(strFileName)
strFileName = Server.MapPath("images") & "\" & strFileName
txtFile.PostedFile.SaveAs(strFileName)
'RaiseEvent UploadComplete()
Else
lblMessage.Visible = True
lblMessage.Text = "File type MUST be in jpeg(jpg) format."
End If
Catch ex As Exception
Me.Visible = False
Response.Write(ex.Message)
End Try
I get an access denied on the strfilename. Any ideas?
Thanks