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.
精彩评论