File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ UPGRADE FROM 1.x to 2.0
2+ ========================
3+
4+ GridFS
5+ ------
6+
7+ * The ` md5 ` is no longer calculated when a file is uploaded to GridFS.
8+ Applications that require a file digest should implement it outside GridFS
9+ and store in metadata.
10+
11+ ``` php
12+ $hash = hash_file('sha256', $filename);
13+ $bucket->openDownloadStream($fileId, ['metadata' => ['hash' => $hash]]);
14+ ```
15+
16+ * The fields ` contentType ` and ` aliases ` are no longer stored in the ` files `
17+ collection. Applications that require this information should store it in
18+ metadata.
19+
20+ ** Before:**
21+ ``` php
22+ $bucket->openDownloadStream($fileId, ['contentType' => 'image/png']);
23+ ```
24+
25+ ** After:**
26+ ``` php
27+ $bucket->openDownloadStream($fileId, ['metadata' => ['contentType' => 'image/png']]);
28+ ```
You can’t perform that action at this time.
0 commit comments