uploading image [RESOLVED]
hey all
im writing an aspx page, which uses the "file field" control to upload image, however im getting a security warning "access denide" do u know what security account asp.net uses ?
many thanks
'ok i dont thnk its a security problem this is the error im getting
System.IO.DirectoryNotFoundException: Could not find a part of the path "D:\Domains\usedseadoo.co.uk\adpics". at System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode) at System.Web.HttpPostedFile.SaveAs(String filename) at usedseadoo.co.uk.placead.Button1_ServerClick(Object sender, EventArgs e) in H:\Live Web Sites\usedseadoo.co.uk\PlaceAd.aspx.vb:line 40
VB Code:
Private Sub Button1_ServerClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ServerClick
If Not (Me.UploadFile.PostedFile Is Nothing) Then
Try
UploadFile.PostedFile.SaveAs("D:\Domains\usedseadoo.co.uk\adpics")
Me.Label2.Text = "File uploaded"
Catch ex As Exception
Me.Label2.Text = "Error saving file <b>C:\\" & _
UploadFile.Value & "</b><br>" & ex.ToString()
End Try
End If
End Sub