(Johan via Bernard)
Reading file buffer in chunks to prevent reaching process memory limits.
File.open("<some path on server>", "wb") do |f| while buff = file_field.read(4096) f.write(buff) end end
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
File.open("<some path on server>", "wb") do |f| while buff = file_field.read(4096) f.write(buff) end end
You need to create an account or log in to post comments to this site.
» Typo current error in ruby rails typo error textdrive setup
» Killing rogue dispatch.fcgi ... in fastcgi lighttpd ruby rails textdrive dispatch.fcgi on processes
» rsrcmeter for TxD in ruby http textdrive disk usage access_log bandwidth quota
» rsrcmeter v2 in ruby http textdrive disk usage access_log bandwidth quota
» Typo under lighttpd in lighttpd ruby rails typo ruby-fcgi
» password hash script in ruby password
Snippets (source code soon to be available) developed by Peter Cooper and powered by Ruby On Rails