Overview

Classes

  • Dropbox\AccessToken
  • Dropbox\AccessType
  • Dropbox\AppInfo
  • Dropbox\AuthInfo
  • Dropbox\Client
  • Dropbox\Config
  • Dropbox\Path
  • Dropbox\RequestToken
  • Dropbox\Token
  • Dropbox\WebAuth
  • Dropbox\WriteMode

Exceptions

  • Dropbox\AppInfoLoadException
  • Dropbox\AuthInfoLoadException
  • Dropbox\DeserializeException
  • Dropbox\Exception
  • Dropbox\Exception_BadRequest
  • Dropbox\Exception_BadResponse
  • Dropbox\Exception_BadResponseCode
  • Dropbox\Exception_InvalidAccessToken
  • Dropbox\Exception_NetworkIO
  • Dropbox\Exception_ProtocolError
  • Dropbox\Exception_RetryLater
  • Dropbox\Exception_ServerError
  • Overview
  • Class
  • Tree

Class WriteMode

Describes how a file should be saved when it is written to Dropbox.

Final
Namespace: Dropbox
Located at Dropbox/WriteMode.php
Methods summary
public static Dropbox\WriteMode
# add( )

Returns a Dropbox\WriteMode for adding a new file. If a file at the specified path already exists, the new file will be renamed automatically.

Returns a Dropbox\WriteMode for adding a new file. If a file at the specified path already exists, the new file will be renamed automatically.

For example, if you're trying to upload a file to "/Notes/Groceries.txt", but there's already a file there, your file will be written to "/Notes/Groceries (1).txt".

You can determine whether your file was renamed by checking the "path" field of the metadata object returned by the API call.

Returns

Dropbox\WriteMode
public static Dropbox\WriteMode
# force( )

Returns a Dropbox\WriteMode for forcing a file to be at a certain path. If there's already a file at that path, the existing file will be overwritten. If there's a folder at that path, however, it will not be overwritten and the API call will fail.

Returns a Dropbox\WriteMode for forcing a file to be at a certain path. If there's already a file at that path, the existing file will be overwritten. If there's a folder at that path, however, it will not be overwritten and the API call will fail.

Returns

Dropbox\WriteMode
public static Dropbox\WriteMode
# update( string $revToReplace )

Returns a Dropbox\WriteMode for updating an existing file. This is useful for when you have downloaded a file, made modifications, and want to save your modifications back to Dropbox. You need to specify the revision of the copy of the file you downloaded (it's the "rev" parameter of the file's metadata object).

Returns a Dropbox\WriteMode for updating an existing file. This is useful for when you have downloaded a file, made modifications, and want to save your modifications back to Dropbox. You need to specify the revision of the copy of the file you downloaded (it's the "rev" parameter of the file's metadata object).

If, when you attempt to save, the revision of the file currently on Dropbox matches $revToReplace, the file on Dropbox will be overwritten with the new contents you provide.

If the revision of the file currently on Dropbox doesn't match $revToReplace, Dropbox will create a new file and save your contents to that file. For example, if the original file path is "/Notes/Groceries.txt", the new file's path might be "/Notes/Groceries (conflicted copy).txt".

You can determine whether your file was renamed by checking the "path" field of the metadata object returned by the API call.

Parameters

$revToReplace
string
$revToReplace

Returns

Dropbox\WriteMode
Dropbox SDK for PHP API documentation generated by ApiGen 2.8.0