Work with GridFS files
Create GridFS buckets, upload files, search, view, rename, save and remove them, and edit their metadata.
GridFS stores files in MongoDB as a bucket: a <bucket>.files collection describing each file and a
<bucket>.chunks collection holding its content. Oxys DB Studio lists every bucket of a database in
the GridFS Buckets folder of the connection tree, and opens
each in a GridFS view where you manage its files without code.
Create a bucket
- Right-click a database and choose Add GridFS Bucket… (or right-click its GridFS Buckets folder > Add Bucket, or use the Database menu).
- Type the bucket name and confirm.
The two collections are created with the standard GridFS indexes, and the bucket appears at once. A bucket that already exists, or a name that would make an invalid collection name, is refused.
Open a bucket
Double-click the bucket in the tree, press Enter on it, or right-click > Open GridFS View. The view lists the bucket’s files in a table: Name, Size (bytes), Type, Uploaded on, MD5, ID and Meta Data, plus any extra fields the file documents hold.
Upload files
- In the GridFS view, press Ctrl+O, or click Add Files…, or right-click > Add Files….
- List the files to upload, one path per line, or click Browse… to pick them.
- Click Add.
Each file is stored under its own name, with a content type guessed from its extension. The upload runs in the Operations panel with its progress and can be cancelled: the file being sent is removed, so no half file is left. Memory use does not depend on the file size.
Find files
- Choose a criterion in Search by, type a value, and press Enter or click the run button.
- Optionally choose Sort by and the direction; the list updates at once.
- Page with the paging buttons, Skip and Limit (default limit 100, at most 10,000).
| Search by | Matches files whose… | Value example |
|---|---|---|
| File search (default) | name contains the value, any case | invoice |
| ID search | _id equals the value | ObjectId("…"), 5 |
| Type search | content type contains the value | image |
| Uploaded before / Uploaded after | upload date is before / after | 2026-01-31 or 2026-01-31T12:00:00Z |
| File size smaller / File size larger | size in bytes is below / above | 1048576 |
| MD5 search | MD5 contains the value | 9e10 |
Sort by offers No Sort, File Name, Size, File ID, File Type, Upload Date and MD5. An empty value lists every file.
Act on files
Select one or more files and right-click:
| Entry | Shortcut | Action |
|---|---|---|
| Add Files… | Ctrl+O | Uploads files |
| Remove File(s) | Del | Deletes the files, after a confirmation naming how many files and the bucket |
| Save To Disk… | Ctrl+S | Writes one file to a path, or several into a folder |
| Rename File… | F2 | Sets a new file name (1 to 1,024 characters) |
| View File | F3 | Shows the start of the file: text, or PNG images inline; other files can be opened with your system viewer |
| Edit Meta Data… | Ctrl+E | Edits the file’s metadata document (empty removes it) |
| Refresh View | Ctrl+R | Lists the current page again |
Save To Disk writes each file to a temporary .part file and renames it when complete, so a failure
or a cancel never leaves a half file nor damages an existing one. If the target exists you are asked
before it is replaced. Saving works on read-only connections, since it does not write to the database.
View File shows only the first part of a large file; the view says so.
Drop a bucket
Right-click the bucket > Drop Bucket (Del). After a confirmation, both collections are dropped and the bucket’s GridFS view closes.
Tips
- Every write here (add or drop a bucket, upload, remove, rename, edit metadata) is refused on a read-only connection before anything is asked or written.
- The
.filesand.chunkscollections also appear in the Collections folder, where you can query them like any collection.
Troubleshooting
| Message | What to do |
|---|---|
| The file … no longer exists | Someone removed it meanwhile. Refresh View. |
| A search value is refused | The value does not fit the criterion (for example a date that is not ISO, or a size that is not a number). |
| Upload cancelled: the file being sent was removed | Files sent before the cancel stay; refresh to see them. |