original_string: public function forceDownload()
      {
  
  
          if ($this->type == "jpg")
  
      {
              $this->toJpg();
  
          } elseif ($this->type == "png") {
  
              $this->toPng();
  
          } elseif ($this->type == "gif") {
  
              $this->toGif();
          }
  
          header('Content-Description: File Transfer');
          header("Content-Type: application/octet-stream");
          header('Content-Length: ' . filesize($this->path));
          header('Content-Disposition: attachment; filename="' . basename($this->path.'"'));
          readfile($this->path);
  
          //remove the temp file
          unlink($this->path);
  
      }
code: public function forceDownload()
      {
  
  
          if ($this->type == "jpg")
  
      {
              $this->toJpg();
  
          } elseif ($this->type == "png") {
  
              $this->toPng();
  
          } elseif ($this->type == "gif") {
  
              $this->toGif();
          }
  
          header('Content-Description: File Transfer');
          header("Content-Type: application/octet-stream");
          header('Content-Length: ' . filesize($this->path));
          header('Content-Disposition: attachment; filename="' . basename($this->path.'"'));
          readfile($this->path);
  
          //remove the temp file
          unlink($this->path);
  
      }
code_tokens: public function forceDownload ( ) { if ( $ this -> type == "jpg" ) { $ this -> toJpg ( ) ; } elseif ( $ this -> type == "png" ) { $ this -> toPng ( ) ; } elseif ( $ this -> type == "gif" ) { $ this -> toGif ( ) ; } header ( 'Content-Description: File Transfer' ) ; header ( "Content-Type: application/octet-stream" ) ; header ( 'Content-Length: ' . filesize ( $ this -> path ) ) ; header ( 'Content-Disposition: attachment; filename="' . basename ( $ this -> path . '"' ) ) ; readfile ( $ this -> path ) ; //remove the temp file unlink ( $ this -> path ) ; }
docstring: Forces the image being manipulated to the user as a force download
docstring_tokens: Forces the image being manipulated to the user as a force download