How is it easier to upload files using FTP in java?

when uploading a file to the server using FTP, associate it by uploading inputStream as a parameter to the specified path, and inputStream also through the new File (path) to get a File object,

if my data is queried from the table and it is a list, instead of a file that already exists in my local file, how can I write this list in inputStream and upload it directly to the FTP server?

Note: means that I want to ask if the file must exist locally before I can upload the file to the FTP server through the inputStream output stream

Apr.09,2021

you can use ByteArrayOutputStream or ByteArrayInputStream as the intermediate stream conversion medium, and then upload FTP directly through the stream

Menu