M
Mark
I have this code running
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
But it produces an access denied error. I have this line in my web.config
<identity impersonate="true"/>
Any Ideas?
Thanks
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
But it produces an access denied error. I have this line in my web.config
<identity impersonate="true"/>
Any Ideas?
Thanks