public function store(UploadFile $file, $location = null, array $option = [])
    {
        if (is_array($location)) {
            $option = $location;
            $location = null;
        }

        if (isset($option['as'])) {
            $filename = $option['as'];
        } else {
            $filename = $file->getHashName();
        }

        if (is_null($location)) {
            $location = $filename;
        } else {
            $location = trim($location, '/') . '/' . $filename;
        }

        return $this->put($location, $file->getContent());
    }
public function store(UploadFile $file, $location = null, array $option = [])
    {
        if (is_array($location)) {
            $option = $location;
            $location = null;
        }

        if (isset($option['as'])) {
            $filename = $option['as'];
        } else {
            $filename = $file->getHashName();
        }

        if (is_null($location)) {
            $location = $filename;
        } else {
            $location = trim($location, '/') . '/' . $filename;
        }

        return $this->put($location, $file->getContent());
    }
public function store ( UploadFile $ file , $ location = null , array $ option = [ ] ) { if ( is_array ( $ location ) ) { $ option = $ location ; $ location = null ; } if ( isset ( $ option [ 'as' ] ) ) { $ filename = $ option [ 'as' ] ; } else { $ filename = $ file -> getHashName ( ) ; } if ( is_null ( $ location ) ) { $ location = $ filename ; } else { $ location = trim ( $ location , '/' ) . '/' . $ filename ; } return $ this -> put ( $ location , $ file -> getContent ( ) ) ; }
Function to upload a file

@param  UploadFile $file
@param  string $location
@param  array $option

@return mixed
@throws InvalidArgumentException
Function to upload a file