A great solution would be to develop a web API for handling file uploads. With this approach, you can easily post the files to the API, which can then manage the process of uploading them to the FTP server seamlessly.
Consider implementing an
<input type="file">
element to allow users to select the files or even create a drag-and-drop feature for a more user-friendly experience.
To send the files to the server, package them in a form and include this form as the payload of an HTTP POST request.
constructor(http: HttpClient) {}
uploadFile(file: File) {
const formData = new FormData();
if (file) {
formData.append('file', file, file.name);
http.post('myApiURL', formData).pipe(take(1)).subscribe()
}
}