Results 1 to 2 of 2

Thread: uploading image [RESOLVED]

  1. #1

    Thread Starter
    Fanatic Member carlblanchard's Avatar
    Join Date
    Sep 2003
    Location
    Bournemouth (UK)
    Posts
    539

    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:
    1. Private Sub Button1_ServerClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ServerClick
    2.         If Not (Me.UploadFile.PostedFile Is Nothing) Then
    3.             Try
    4.                 UploadFile.PostedFile.SaveAs("D:\Domains\usedseadoo.co.uk\adpics")
    5.                 Me.Label2.Text = "File uploaded"
    6.             Catch ex As Exception
    7.                 Me.Label2.Text = "Error saving file <b>C:\\" & _
    8.                 UploadFile.Value & "</b><br>" & ex.ToString()
    9.  
    10.             End Try
    11.         End If
    12.  
    13.     End Sub
    Last edited by carlblanchard; Apr 4th, 2004 at 02:00 PM.
    I am curretly building a defect management system for software and web developers,
    If you wana try it out (beta test) and keep it for free just send me a message

  2. #2
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    Make sure the ASPNET account has the correct permissions on this location.
    D:\Domains\usedseadoo.co.uk\adpics
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width