开发者

Doctrine 2 ODM MongoDB storing images in GridFS from memory

开发者 https://www.devze.com 2023-04-12 20:13 出处:网络
i want to store uploaded files in mongodb as GridFsFile. Im using the doctrine 2开发者_运维技巧 odm. it works fine when i read a file from disk and store it. But what i would like to achieve is to avo

i want to store uploaded files in mongodb as GridFsFile. Im using the doctrine 2开发者_运维技巧 odm. it works fine when i read a file from disk and store it. But what i would like to achieve is to avoid storing the uploaded files anywhere on file system.

Is it possible to store the binary string directly?


According to the answer to this question, PHP always writes uploaded files to a temporary directory, and the _FILES array just points to those uploaded files.

You might consider setting PHP's upload_tmp_dir to a directory you've mounted as tmpfs or ramfs to avoid writing the files to disk. see here for a comparison of the two memory-based file systems.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号