uploadFile from Angular4 to Symfony : POST Method

I would like to use an Angular4 form to send a file to Symfony via the POST method.

After some research, I came across this method:

upload(event): void
    console.log('File : ', event.target.files[0]);
    let formData = new FormData();
    formData.append('File', event.target.files[0]);
    console.log('FormData:', formData);
    this.myService.upload(formData).subscribe((res) => 
    console.log('res : ', res))

But I already have a problem here. The formData log returns an empty object...

Return of console.log :

FormData: FormData {}__proto__: FormData
File : File {name: "images.jpg", lastModified: 1507624281000, lastModifiedDate: Tue Oct 10 2017 10:31:21 GMT+0200 (CEST), webkitRelativePath: "", size: 52001, …}

If you know another way to send a file (jpeg/png) to Symfony I'm really interested, I've been blocking it for a while... Thank you in advance and good day/evening.

The input type File:

<input (change)="upload($event)" type="file" class="form-control" id="file" (ngModel)="model.file" name="file" required>


I solved my problem.

Here's the solution:

On the Symfony side, the formData functioned correctly, you just had to add (to recover the file:)

$file = $request->files->get('File');

--' <= I feel noob...

See you soon:)