public function putFileAs($path, $file, $name, $options = [])
    {
        $stream = fopen($file->getRealPath(), 'r+');

        // Next, we will format the path of the file and store the file using a stream since
        // they provide better performance than alternatives. Once we write the file this
        // stream will get closed automatically by us so the developer doesn't have to.
        $result = $this->put(
            $path = trim($path.'/'.$name, '/'), $stream, $options
        );

        if (is_resource($stream)) {
            fclose($stream);
        }

        return $result ? $path : false;
    }
public function putFileAs($path, $file, $name, $options = [])
    {
        $stream = fopen($file->getRealPath(), 'r+');

        // Next, we will format the path of the file and store the file using a stream since
        // they provide better performance than alternatives. Once we write the file this
        // stream will get closed automatically by us so the developer doesn't have to.
        $result = $this->put(
            $path = trim($path.'/'.$name, '/'), $stream, $options
        );

        if (is_resource($stream)) {
            fclose($stream);
        }

        return $result ? $path : false;
    }
public function putFileAs ( $ path , $ file , $ name , $ options = [ ] ) { $ stream = fopen ( $ file -> getRealPath ( ) , 'r+' ) ; // Next, we will format the path of the file and store the file using a stream since // they provide better performance than alternatives. Once we write the file this // stream will get closed automatically by us so the developer doesn't have to. $ result = $ this -> put ( $ path = trim ( $ path . '/' . $ name , '/' ) , $ stream , $ options ) ; if ( is_resource ( $ stream ) ) { fclose ( $ stream ) ; } return $ result ? $ path : false ; }
Store the uploaded file on the disk with a given name.

@param  string  $path
@param  \Sirius\Filesystem\File|\Sirius\Filesystem\UploadedFile|\SplFileInfo  $file
@param  string  $name
@param  array  $options

@return string|false
Store the uploaded file on the disk with a given name .