Home Forums .NET libraries Xceed SFTP/FTP for .NET DiskFolder method is not recognizing mapped drive if called from WCF

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #21036 |

    Hi

    Our project is developed using WCF and VS2008. The WCF is hosted as windows service with ‘Log on as:’ ‘Local System Account’.

    The WCF is calling the workflow and it has the code to perform FTP. We are using xceed ftp dlls to perform FTP.

    The FTP code works fine if I specify the target folder as my local folder. But it fails if I specify a mapped drive.

    This problem happens only if I call the method via WCF service and not when I directly run.

    Please find the source code below:

    ———————

    private

    static FtpClient client = null;

    private

    static int PerformFTPDownload(FTPWorkerConfiguration fwc)

    {

    client.ChangeCurrentFolder(fwc.SourceDirectory);

    newFolder = new DiskFolder(fwc.TargetDirectory);

    if

    (!newFolder.Exists) <— newFolder.Exists = false for mapped drive and true for local folder)

    }

    ———————

    There are no exception thrown but the DiskFolder() method couldn’t identify the mapped drive. 

    Let me know if I can provide more details to identify the problem. 

    Thanks in advance

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Yogeesh (had 1591 views)

    Xceed Support
    Member
    Post count: 5658

    Hi,

    a possible workaround is to ensure that you are giving the nessary permissions to access the mapped drive to the account used by the WCF service. This WCF service might not be running in your authentication context.  

     

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Mohamed [Xceed] (had 345 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks for your reply….

    The thing is I am not pretty sure on giving the permission to the “right account”. Following are what I tried.

    1. Hosted the win service with ‘Local system account’. This showed ‘NT AUTHORITY\SYSTEM’ as the user in process monitor (a MS tool).

    2. Hosted the win service with my local system account (a domain id/pwd). This showed my account as the user in process monitor.

    Regarding the authentication context, I am new to this area…. what I observed is, whenever the control gets transferred from client to the service, all the credentials gets lost. All the static values/session values etc are only available for the UI project (i.e., client).

    Do we have some documentation on the method DiskFolder() on how the authentication is read by this method?

    Thanks

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Yogeesh (had 578 views)

    User (Old forums)
    Member
    Post count: 23064

    [quote user=”Yogeesh”]

    Do we have some documentation on the method DiskFolder() on how the authentication is read by this method?

    [/quote]

    It does no authentication.  It is the OS that manages these permissions (i.e. setting the application with the right permissions, and making sure it accesses only the permitted resources). 

     

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by André (had 1839 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.