title: Upload Image With angular 8
body: <p>I am having issues in image upload in my file '../src/app/assets/'.I have this Form</p>
  
  <pre><code> &lt;form [formGroup]="formRegister" novalidate=""&gt;  
      &lt;div class="form-group"&gt;
          &lt;label for="exampleInputImage"&gt;Image&lt;/label&gt;
          &lt;input type="file" (change)="onFileSelect($event)" name="image" 
             class="form-control" placeholder="Enter votre image"&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  &lt;button type="button" (click)="onRegister()"&gt;Submit&lt;/button&gt;
  </code></pre>
  
  <p>In my ts </p>
  
  <pre><code>formRegister: FormGroup;
  errorMail: string = "";
  selectedFile: File = null;
  
  constructor(private appService: AppServiceService, private http: HttpClient) { }
  
  ngOnInit() {
  this.formRegister = new FormGroup({      
    image: new FormControl('', [Validators.required])
  });
  }
  
  
  onFileSelect(event) {
    console.log("event : ", event);
    this.selectedFile = &lt;File&gt;event.target.files[0];
   }
  
  onRegister(): void {
  const fd = new FormData();
  fd.append('image', this.selectedFile);
  const req = new HttpRequest('POST', '../src/app/assets/', fd);
  this.http.request(req).subscribe(events =&gt; {
    console.log("Upload Image", events);
  },
    (err: HttpErrorResponse) =&gt; {
      console.log("Erreur : ", err.message);    // Show error, if any.
    });
  }
  </code></pre>
  
  <p>In my console i have an errors :
  <a href="http://localhost:4200/src/app/assets/" rel="nofollow noreferrer">http://localhost:4200/src/app/assets/</a> 404 (Not Found)</p>
  
  <p>Where is the problem in my code and thanks.</p>