src/Client.php
public function createFile(
        $name,
        $parentId = null,
        $content = '',
        array $options = []
    ) {
        $message = sprintf(
            '%s() is deprecated and will be removed in version 3;'
                . ' use Krizalys\Onedrive\Proxy\DriveItemProxy::upload()'
                . ' instead',
            __METHOD__
        );

        @trigger_error($message, E_USER_DEPRECATED);
        $drive = $this->getMyDrive();

        $item = $parentId !== null ?
            $this->getDriveItemById($drive->id, $parentId)
            : $drive->getRoot();

        $item    = $item->upload($name, $content);
        $options = $this->buildOptions($item, ['parent_id' => $parentId]);

        return new File($this, $item->id, $options);
    }
public function createFile(
        $name,
        $parentId = null,
        $content = '',
        array $options = []
    ) {
        $message = sprintf(
            '%s() is deprecated and will be removed in version 3;'
                . ' use Krizalys\Onedrive\Proxy\DriveItemProxy::upload()'
                . ' instead',
            __METHOD__
        );

        @trigger_error($message, E_USER_DEPRECATED);
        $drive = $this->getMyDrive();

        $item = $parentId !== null ?
            $this->getDriveItemById($drive->id, $parentId)
            : $drive->getRoot();

        $item    = $item->upload($name, $content);
        $options = $this->buildOptions($item, ['parent_id' => $parentId]);

        return new File($this, $item->id, $options);
    }
public function createFile ( $ name , $ parentId = null , $ content = '' , array $ options = [ ] ) { $ message = sprintf ( '%s() is deprecated and will be removed in version 3;' . ' use Krizalys\Onedrive\Proxy\DriveItemProxy::upload()' . ' instead' , __METHOD__ ) ; @ trigger_error ( $ message , E_USER_DEPRECATED ) ; $ drive = $ this -> getMyDrive ( ) ; $ item = $ parentId !== null ? $ this -> getDriveItemById ( $ drive -> id , $ parentId ) : $ drive -> getRoot ( ) ; $ item = $ item -> upload ( $ name , $ content ) ; $ options = $ this -> buildOptions ( $ item , [ 'parent_id' => $ parentId ] ) ; return new File ( $ this , $ item -> id , $ options ) ; }
Creates a file in the current OneDrive account.

@param string $name
The name of the OneDrive file to be created.
@param null|string $parentId
The ID of the OneDrive folder into which to create the OneDrive
file, or null to create it in the OneDrive root folder. Default:
null.
@param string|resource|\GuzzleHttp\Psr7\Stream $content
The content of the OneDrive file to be created, as a string or as
a resource to an already opened file. Default: ''.
@param array $options
The options.

@return File
The file created, as File instance referencing to the OneDrive
file created.

@throws Exception
Thrown on I/O errors.

@deprecated Use Krizalys\Onedrive\Proxy\DriveItemProxy::upload() instead.

@todo Support name conflict behavior.
@todo Support content type in options.
Creates a file in the current OneDrive account .