We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 220cd30 commit 579f743Copy full SHA for 579f743
1 file changed
src/MsgraphAdapter.php
@@ -47,6 +47,22 @@ public function __construct(array $config)
47
48
public function write($path, $contents, Config $config)
49
{
50
+ $path = '/drives/' . $this->config['drive_id'] . '/root:/' . $path;
51
+
52
+ $file = $this->graph
53
+ ->createRequest('PUT', $path . ':/content')
54
+ ->attachBody($contents)
55
+ ->setReturnType(Model\DriveItem::class)
56
+ ->execute()
57
+ ->getBody();
58
+ return [
59
+ 'type' => 'file',
60
+ 'path' => $path,
61
+ 'timestamp' => $file->getLastModifiedDateTime()->getTimestamp(),
62
+ 'size' => $file->getSize(),
63
+ 'mimetype' => $file->getFile()->getMimeType(),
64
+ 'visibility' => 'public',
65
+ ];
66
}
67
68
public function writeStream($path, $resource, Config $config)
0 commit comments