Skip to content

Commit ba7dded

Browse files
committed
Add UPGRADE instructions
1 parent 346c4f6 commit ba7dded

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

UPGRADE-2.0.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
```

0 commit comments

Comments
 (0)