locked
how to upload file outside project directory RRS feed

  • Question

  • User-535616387 posted

    Hi Guys,

    my project location in : C:\MyProject 

    i got error when upload file to another directory (C:\UploadFile)

    my question : how to upload file to another directory ( C:\UploadFile ) ?

    my code :

    Dim file_path =  fileupload_document.FileName
    
    file_path = "C:\UploadFile\" & file_path
    
    fileupload_document.SaveAs(file_path )
    			

    Thanks & Best Regards.
    "Wibowo Wiwit"

    Thursday, January 31, 2019 2:42 AM

Answers

  • User-943250815 posted

    What error you get?
    Is there write permission set on C:\UploadFile for application user?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 31, 2019 11:22 AM
  • User753101303 posted

    Hi,

    got error

    Instead always tell which error you have. More likely the account under which your app runs is not allowed to write to this folder. Depending on your config see https://docs.microsoft.com/en-us/iis/manage/configuring-security/application-pool-identities#securing-resources to grant access to this folder.

    BTW most often I'm not using the file client side name. For example if another user (or the same) upload another file named the same way it would be overwritten.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 31, 2019 11:32 AM

All replies

  • User-943250815 posted

    What error you get?
    Is there write permission set on C:\UploadFile for application user?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 31, 2019 11:22 AM
  • User753101303 posted

    Hi,

    got error

    Instead always tell which error you have. More likely the account under which your app runs is not allowed to write to this folder. Depending on your config see https://docs.microsoft.com/en-us/iis/manage/configuring-security/application-pool-identities#securing-resources to grant access to this folder.

    BTW most often I'm not using the file client side name. For example if another user (or the same) upload another file named the same way it would be overwritten.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 31, 2019 11:32 AM