Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading a file from gridfs which was written with an other client fails #40

Open
ctradu opened this issue Oct 31, 2014 · 0 comments
Open

Comments

@ctradu
Copy link

ctradu commented Oct 31, 2014

Let there be a file on disk:
/usr/local/.../094509-ac0c558a-6008-11e4-9a5d-e7ef2b7188c7.mp3

This file is uploaded using pymongo or using mongofiles.
When I try to open it using erlmongo/gridfs using the following sequence:

Db1 = mongoapi:new("ouc3", "collection")
Pid = mongoapi:gfsOpen(<<"fs">>, #gfs_file{filename = <<"/usr/local/.../094509-ac0c558a-6008-11e4-9a5d-e7ef2b7188c7.mp3">>}, Db1).
Bin = mongoapi:gfsRead(Pid, 67248, Db1).
=> false

From what I see in the code the 5000 ms timeout is reached and false is returned.

Everything is fine when I try to do the same for a file written using the following sequence:
Pid = Db:gfsNew(?REC_GFS_BUCKET, FilePath, [{}]),
Db:gfsWrite(Pid, BinFile),
Db:gfsClose(Pid),

Also, If I download the file using mongofiles and listen it (it is a wav in my case) it all goes fine.
What I do not understand is why erlmongo fails to read those files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant