Connect to FTP

I was wondering, using the built in connect() function for TCP connections, how would I connect to a FTP and write to a text file? I can’t find any good information about connecting this way.

FTP is an ancient, obsolete, and quite strange (by today’s standards) protocol. While there are Node libraries implementing it, they are unlikely to work in Workers, so you would probably have to implement the entire thing yourself. (And only PASV mode would work.)

I’d recommend using literally any other protocol. An HTTP upload would be easy, given server-side support.

1 Like

while what @i40west says is generally true, if you still need to access a FTP Server you can do so via the TCP Sockets API.

The workerd-ftp package implements a FTPClient for workers.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.