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

  1. Right-click a database and choose Add GridFS Bucket… (or right-click its GridFS Buckets folder > Add Bucket, or use the Database menu).
  2. 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

  1. In the GridFS view, press Ctrl+O, or click Add Files…, or right-click > Add Files….
  2. List the files to upload, one path per line, or click Browse… to pick them.
  3. 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

  1. Choose a criterion in Search by, type a value, and press Enter or click the run button.
  2. Optionally choose Sort by and the direction; the list updates at once.
  3. Page with the paging buttons, Skip and Limit (default limit 100, at most 10,000).
Search byMatches files whose…Value example
File search (default)name contains the value, any caseinvoice
ID search_id equals the valueObjectId("…"), 5
Type searchcontent type contains the valueimage
Uploaded before / Uploaded afterupload date is before / after2026-01-31 or 2026-01-31T12:00:00Z
File size smaller / File size largersize in bytes is below / above1048576
MD5 searchMD5 contains the value9e10

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:

EntryShortcutAction
Add Files…Ctrl+OUploads files
Remove File(s)DelDeletes the files, after a confirmation naming how many files and the bucket
Save To Disk…Ctrl+SWrites one file to a path, or several into a folder
Rename File…F2Sets a new file name (1 to 1,024 characters)
View FileF3Shows the start of the file: text, or PNG images inline; other files can be opened with your system viewer
Edit Meta Data…Ctrl+EEdits the file’s metadata document (empty removes it)
Refresh ViewCtrl+RLists 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 .files and .chunks collections also appear in the Collections folder, where you can query them like any collection.

Troubleshooting

MessageWhat to do
The file … no longer existsSomeone removed it meanwhile. Refresh View.
A search value is refusedThe 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 removedFiles sent before the cancel stay; refresh to see them.