简体   繁体   中英

Doctrine 2 ODM MongoDB storing images in GridFS from memory

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM