Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for a DropboxFile from stream #46

Merged
merged 1 commit into from
Apr 22, 2017
Merged

Add support for a DropboxFile from stream #46

merged 1 commit into from
Apr 22, 2017

Conversation

jnstr
Copy link
Contributor

@jnstr jnstr commented Apr 12, 2017

Sometimes we need to upload a file that isn't on the filesystem but is already a file stream.
This commit adds a new static function CreateByStream that allows us to create a new DropboxFile instance using a stream.

You can now instantiate a new DropboxFile using these static functions:

// create new DropboxFile from stream
$dropboxFile = DropboxFile::createByStream($fileName, $fileStream, DropboxFile::MODE_READ);

// create new DropboxFile from path (same as the constructor but just added in order to match the createByPath function)
$dropboxFile = DropboxFile::createByPath($filePath ,DropboxFile::MODE_READ);

Sometimes we need to upload a file that isn't on the filesystem but is already a file stream.
This commit adds a new static function CreateByStream that allows us to create a new DropboxFile instance using a stream.
@kunalvarma05 kunalvarma05 merged commit 3f74cc8 into kunalvarma05:master Apr 22, 2017
@kunalvarma05
Copy link
Owner

@jnstr Thanks for the contribution :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants