From the GridFS spec:
However, drivers MUST be able to handle existing GridFS files where the length and chunkSize fields might have been stored using a different numeric data type.
It appears that the initial GridFS implementation does not correctly handle downloads of files where the "chunkSize" element from the files document is stored as a 64-bit integer.
In addition, the GridFS API should document that users may not specify a chunk size larger than the maximum value for int32_t when uploading files. Currently, the user-provided chunk size value is narrowed to int32_t in the mongocxx::uploader constructor (when sizeof(size_t) is greater than 4 on the user's system). We should audit the rest of the logic surrounding the handling of these values.