original_string: public function addUploadedFile(UploadedFileInterface $upload, string $field = null, array $crop = null): string
      {
          $tmp_dir = $this->getTmpDir();
          $tmp_name = Utils::generateRandomString(12);
          $name = $upload->getClientFilename();
  
          // Prepare upload data for later save
          $data = [
              'name' => $name,
              'type' => $upload->getClientMediaType(),
              'size' => $upload->getSize(),
              'tmp_name' => $tmp_name
          ];
  
          Folder::create($tmp_dir);
          $upload->moveTo("{$tmp_dir}/{$tmp_name}");
  
          $this->addFileInternal($field, $name, $data, $crop);
  
          return $name;
      }
code: public function addUploadedFile(UploadedFileInterface $upload, string $field = null, array $crop = null): string
      {
          $tmp_dir = $this->getTmpDir();
          $tmp_name = Utils::generateRandomString(12);
          $name = $upload->getClientFilename();
  
          // Prepare upload data for later save
          $data = [
              'name' => $name,
              'type' => $upload->getClientMediaType(),
              'size' => $upload->getSize(),
              'tmp_name' => $tmp_name
          ];
  
          Folder::create($tmp_dir);
          $upload->moveTo("{$tmp_dir}/{$tmp_name}");
  
          $this->addFileInternal($field, $name, $data, $crop);
  
          return $name;
      }
code_tokens: public function addUploadedFile ( UploadedFileInterface $ upload , string $ field = null , array $ crop = null ) : string { $ tmp_dir = $ this -> getTmpDir ( ) ; $ tmp_name = Utils :: generateRandomString ( 12 ) ; $ name = $ upload -> getClientFilename ( ) ; // Prepare upload data for later save $ data = [ 'name' => $ name , 'type' => $ upload -> getClientMediaType ( ) , 'size' => $ upload -> getSize ( ) , 'tmp_name' => $ tmp_name ] ; Folder :: create ( $ tmp_dir ) ; $ upload -> moveTo ( "{$tmp_dir}/{$tmp_name}" ) ; $ this -> addFileInternal ( $ field , $ name , $ data , $ crop ) ; return $ name ; }
docstring: Add uploaded file to the form flash.
  
  @param UploadedFileInterface $upload
  @param string|null $field
  @param array|null $crop
  @return string Return name of the file
docstring_tokens: Add uploaded file to the form flash .