title: Send image file from angular to php
body: <p>I'm trying to send image that choose from angular app to my php here is what i do.</p>
  
  <pre><code> onSubmit(e) {
      e.preventDefault();
         this.submitted = true;
          if (this.profilForm.invalid) {
              return;
          }
                  this.email  = this.profilForm.controls['email_txt'].value;
  
          this.fullname   = this.profilForm.controls['fullname_txt'].value;
          this.address    = this.profilForm.controls['address_txt'].value;
          this.telp       = this.profilForm.controls['telp_txt'].value;
  
          this.profilapi.updateProfil( this.fullname, this.address , this.telp , this.email, this.selectedFile ).subscribe((data:  Array&lt;object&gt;) =&gt; {
                  this.userinfo  =  data;
                  console.log( "blablabla - " + this.userinfo);
                  this.alertService.danger("Something wrong please try again later");
  
         },
         error =&gt; {               
                  console.log( "err - " + error );
                  this.alertService.danger("Something error, please try again later");
              }
         );
  
    }
  
      onFileChanged(event) {
          this.selectedFile = event.target.files[0]
      }
  </code></pre>
  
  <p>my service</p>
  
  <pre><code>updateProfil(fullname,address,telp,email,profil){
          return  this.httpClient.post(
                  `${this.API_URL}` , 
                  {   
                      "fullname" : fullname, 
                      "address" : address , 
                      "telp" : telp , 
                      "email" : email , 
                      "profil" : profil
                  } 
                  );
      }
  </code></pre>
  
  <p>ini here is my php so far.</p>
  
  <pre><code>&lt;?php
  
  include_once("Crud.php");
  $crud = new Crud();
  
  header('Access-Control-Allow-Origin: *');
  header('Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE, OPTIONS');
  header('Access-Control-Allow-Headers: Origin, Content-Type, X-Auth-Token');
  
  $postdata   = file_get_contents("php://input");
  $request    = json_encode($postdata);
  $email      = $request-&gt;email;
  $fullname   = $request-&gt;fullname;
  $address    = $request-&gt;address;
  $phone      = $request-&gt;phone;
  echo $email;
  ?&gt;
  </code></pre>
  
  <p>how can i receive the image at my php and upload it to specified folder ? thanks in advance and sorry for my english.</p>