private function prepareDefaultHeaders()
    {
        // Set a default content-disposition header if one was no provided
        if (!$this->hasHeader('Content-Disposition')) {
            $this->headers['Content-Disposition'] = sprintf(
                'form-data; name="%s"; filename="%s"',
                $this->name,
                basename($this->filename)
            );
        }

        // Set a default Content-Type if one was not supplied
        if (!$this->hasHeader('Content-Type')) {
            $this->headers['Content-Type'] = Mimetypes::getInstance()
                ->fromFilename($this->filename) ?: 'text/plain';
        }
    }
private function prepareDefaultHeaders()
    {
        // Set a default content-disposition header if one was no provided
        if (!$this->hasHeader('Content-Disposition')) {
            $this->headers['Content-Disposition'] = sprintf(
                'form-data; name="%s"; filename="%s"',
                $this->name,
                basename($this->filename)
            );
        }

        // Set a default Content-Type if one was not supplied
        if (!$this->hasHeader('Content-Type')) {
            $this->headers['Content-Type'] = Mimetypes::getInstance()
                ->fromFilename($this->filename) ?: 'text/plain';
        }
    }
private function prepareDefaultHeaders ( ) { // Set a default content-disposition header if one was no provided if ( ! $ this -> hasHeader ( 'Content-Disposition' ) ) { $ this -> headers [ 'Content-Disposition' ] = sprintf ( 'form-data; name="%s"; filename="%s"' , $ this -> name , basename ( $ this -> filename ) ) ; } // Set a default Content-Type if one was not supplied if ( ! $ this -> hasHeader ( 'Content-Type' ) ) { $ this -> headers [ 'Content-Type' ] = Mimetypes :: getInstance ( ) -> fromFilename ( $ this -> filename ) ? : 'text/plain' ; } }
Applies default Content-Disposition and Content-Type headers if needed.
Applies default Content - Disposition and Content - Type headers if needed .