Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法使用类似于 x-sendfile 的东西来上传文件,例如将特定的流/参数从请求保存到文件,而不将其完全放入内存?(特别是 apache2 和 ruby fcgi)
require 'open-uri' CHUNK_SIZE = 8192 File.open("local_filename.dat","w") do |w| open("http://some_file.url") do |r| w.write(r.read(CHUNK_SIZE)) while !r.eof? end end
Apache 的 ModPorter 似乎就是这样。