Access problem here

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top