0

I have made a winform application that program is ftpClient using FluentFtp.dll(c# library).

My question is "Could I make web ftpClient".

I don't know well blazor.net.

but I heard that tech is able to make frontend using c#.

I have tried my ftpClient code move to @code{} block.

private void GetListFTP()
{
    FluentFTP.FtpClient ftpClient = new FluentFTP.FtpClient("server host","server port(integer)","my id","my password");
    IList<FluentFTP.FtpListItem> items = ftpClient.GetListing("/", FluentFTP.FtpListOption.ForceList);
    IList<string> listStr = items.Select(itm => itm.Input).ToList();
}

but that code just work on Server(not Browser!).

If it isn't available, please recommand me javascript ftp libary.

1min
  • 1
  • 2
  • ftpClient client handles ftp requests and responses. and with blazor you can present the responses on web page. it is possible but of course you need manually create the pages. – Lei Yang Jun 30 '21 at 08:44
  • There's no `Blazor.Net` to begin with. Blazor runs on .NET Core so any FTP library that targets .NET Core or .NET Standard will work – Panagiotis Kanavos Jun 30 '21 at 08:44
  • i said ftpClient client handles ftp, not HttpClient – Lei Yang Jun 30 '21 at 08:50
  • @LeiYang there's no `FtpClient` in .NET or .NET Core. The only built-in FTP support comes from FtpWebRequest. There was a third-party library with the unfortunate name `System.Net.Ftp`, which was renamed to `FluentFtp` in 2015 – Panagiotis Kanavos Jun 30 '21 at 08:52
  • then change `ftpClient` to `FluentFtp.dll`. but i don't get your point. do you think it is impossible to create 'ftpclient in browser' with blazor? – Lei Yang Jun 30 '21 at 08:55
  • @1min `that code just work on Server(not Browser!).` what code and what's the exact problem? Adding a DLL directly won't work. – Panagiotis Kanavos Jun 30 '21 at 09:00

1 Answers1

1

A Blazor app is either Blazor WebAssembly or Blazor Server.

On WebAssembly you can't do FTP. As far as I know the only JS libraries are for Node.

On Blazor Server you can use any FTP client library available.

When your app runs in a Browser (regardless what framework) you need a Server to do your FTP, SMTP, Database access etc.

H H
  • 263,252
  • 30
  • 330
  • 514