Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GenericAccountDirectories always result in a path relative to the rootPath #125

Open
JeanRessouche opened this issue Jan 14, 2022 · 2 comments
Assignees
Labels

Comments

@JeanRessouche
Copy link

Hello, i have the following issue, i think that it was mentioned (but denied) in this case .

services.Configure<DotNetFileSystemOptions>(opt => { opt.RootPath = @"c:\anonymous"; }); ... public IAccountDirectories GetDirectories(IAccountInformation accountInformation) { return new GenericAccountDirectories(rootPath: "c:\mypath"); }

Read/Write operations are performed on c:\anonymous\mypath\

Expected: c:\mypath

@fubar-coder
Copy link
Contributor

It seems that there was a similar problem in #74 and it seems that the order of the IAccountDirectoryQuery registration is important. It has the be registered after the AddFtpServer, because it'll be "overwritten" if you register it before the AddFtpServer.

@JeanRessouche
Copy link
Author

JeanRessouche commented Jan 15, 2022

Hum apparently no i do add the IAccountDirectoryQuery after the AddFtpServer:

               services.Configure<DotNetFileSystemOptions>(opt =>
                {
                    opt.RootPath = _configuration["Messages:Folder"];
                    opt.FlushAfterWrite = true;
                });

                services.AddFtpServer(builder => builder.UseDotNetFileSystem());

                services.AddSingleton<IAccountDirectoryQuery, FtpAccountDirectoryQuery>();

                services.Configure<FtpServerOptions>(opt =>
                {
                    opt.ServerAddress = _configuration["FtpListener:Ip"];
                    opt.Port = _configuration.GetSection("FtpListener").GetValue<int>("Port");
                    opt.MaxActiveConnections = 100;
                    opt.ConnectionInactivityCheckInterval = TimeSpan.FromMinutes(2);
                });

Note: breakpoint do step by my IAccountDirectoryQuery implementation.

@fubar-coder fubar-coder self-assigned this Jan 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants