Closed anyulled closed 3 years ago
Same here. I've even tried hardcoding the access token values and can't get it to work. I would imagine it should be possible though. Hopefully someone can help out.
@anyulled @ChrstnMgcn Yes, you can use this library to do it. You can use DriveItemProxy::upload()
, it supports both string (eg. direct file contents) and streams (eg. file handles opened from the filesystem.
Here is an example with a file resource: https://github.com/krizalys/onedrive-php-sdk/blob/master/test/functional/Proxy/DriveItemProxyTest.php#L287-L295 - in your case, you'll probably need something like:
$content = fread('/path/to/file', 'rb');
$driveItem->upload('my file', $content);
I need my application to receive uploaded files from a web form and upload them to my OneDrive unit. I already handle the uploading part and would like to know if it's possible to upload those files from my temporal path to oneDrive