I've been working on GridFS with MongoDB + PHP
and able to perform CRUD
operations. I need to fetch the file extension types being uploaded. For example see below type
that is being saved in Mongo for different file types:
image = image/jpeg or image/png
text = text/plain
docx = application/octet-stream
xlsx = application/octet-stream
pdf = application/pdf
How can I fetch or convert the above mentioned file types like below
image = jpeg or png
text = txt
docx = doc
xlsx = xlsx
pdf = pdf
Is there any function available to achieve the same ?
Also when any PDF
or image
of bigger size is uploaded, it inserts more than one records in DB in following form
{
"_id" : ObjectId("542118ab920662000a000055"),
"filename" : "blob",
"type" : "application/octet-stream",
"title" : "blob",
"isFolder" : 0,
"uploadDate" : ISODate("2014-09-23T06:52:27.000Z"),
"length" : 338277,
"chunkSize" : 261120,
"md5" : "d4f9269491c30a0ab086b3bab02c81ee"
}
Please Help.
Thanks.