lib/FormBody.php
public function addFile(string $name, string $filePath, string $contentType = 'application/octet-stream') {
        $fileName = \basename($filePath);
        $this->fields[] = [$name, new FileBody($filePath), $contentType, $fileName];
        $this->isMultipart = true;
        $this->resetCache();
    }
public function addFile(string $name, string $filePath, string $contentType = 'application/octet-stream') {
        $fileName = \basename($filePath);
        $this->fields[] = [$name, new FileBody($filePath), $contentType, $fileName];
        $this->isMultipart = true;
        $this->resetCache();
    }
public function addFile ( string $ name , string $ filePath , string $ contentType = 'application/octet-stream' ) { $ fileName = \ basename ( $ filePath ) ; $ this -> fields [ ] = [ $ name , new FileBody ( $ filePath ) , $ contentType , $ fileName ] ; $ this -> isMultipart = true ; $ this -> resetCache ( ) ; }
Add a file field to the form entity body.

@param string $name
@param string $filePath
@param string $contentType
Add a file field to the form entity body .