Can you put ESP32 FTP client constructor in setup()

Yes, create the ESP32_FTPClient object dynamically in setup().

ESP32_FTPClient * ftp;
...
void setup() {
  ...
  ftp = new ESP32_FTPClient(ftp_server, ftp_user, ftp_pass, 5000, 0);

Note: ftp is now not the object itself but a pointer/reference to it, so you will need to de-reference the pointer when you use it in your other code:

ftp.doXYZ();

becomes

ftp->doXYZ();
1 Like