This is a legacy RCR. If this is your RCR, please resubmit it using the new format and process.
I agree that it's pretty silly to have tempfile objects for every parameter. It makes sense for uploaded files to be made into Tempfiles, but not much else. I got bothered the most, though, by the interface change.
CGI.new("html4") # html4.0 (Strict)<br />> CGI.new("html4Tr") # html4.0 TransitionalVERSION = '2.1.4'<br />> RELEASE_DATE = '2001-04-18'
string.gsub(/[^a-zA-Z0-9_-.]/n){ sprintf("%%%02X", $&.unpack("C")[0]) }<br />> # string.gsub(/([^ a-zA-Z0-9_.-]+)/n) do string.gsub(/+/, ' ').gsub(/%([0-9a-fA-F]{2})/){ [$1.hex].pack("c") }<br />> # string.tr('+', ' ').gsub(/((?:%[0-9a-fA-F]{2})+)/n) doif options.kind_of?(String)<br />411,412d417
options["type"].concat( "; charset=" )<br />> options["type"].concat( options.delete("charset") )
buf.concat( (env_table["SERVER_PROTOCOL"] or "HTTP/1.0") + " " )<br />> buf.concat( (HTTP_STATUS[options["status"]] or
status = (HTTP_STATUS[options["status"]] or options["status"])<br />> buf.concat("Status: " + status + EOL)
buf.concat("Server: " + options.delete("server") + EOL)<br />452c463 buf.concat("Connection: " + options.delete("connection") + EOL)<br />455c466 buf.concat("Content-Type: " + options.delete("type") + EOL)<br />458c469 buf.concat("Content-Length: " + options.delete("length").to_s + EOL)<br />462c473 buf.concat("Content-Language: " + options.delete("language") + EOL)<br />466c477 buf.concat("Expires: " + CGI::rfc1123_date( options.delete("expires") ) + EOL)<br />472c483 buf.concat("Set-Cookie: " + options.delete("cookie").to_s + EOL)<br />475c486 buf.concat("Set-Cookie: " + cookie.to_s + EOL)<br />479c490 buf.concat("Set-Cookie: " + cookie.to_s + EOL)<br />485c496 buf.concat("Set-Cookie: " + cookie.to_s + EOL)<br />490c501buf.concat(key + ": " + value + EOL)<br />502d512
class Cookie # #super(@value)<br />661c668
buf.concat(@name + '=')<br />664c671
buf.concat CGI::escape(@value)<br />666c673
buf.concat(@value.collect{|v| CGI::escape(v) }.join("&"))<br />670c677 buf.concat('; domain=' + @domain)<br />674c681 buf.concat('; path=' + @path)<br />678c685 buf.concat('; expires=' + CGI::rfc1123_date(@expires))<br />682c689 buf.concat('; secure')<br />705c712,714if cookies.has_key?(name)<br />> cookies[name].value.push(*values)
eval_methods eval_methods eval(eval_methods)<br />>
bodyvar = ''<br />> isFile = false
bodyvar += buf[0 ... (buf.size - (EOL + boundary + EOL).size)]<br />822c834
buf.concat c<br />828c840
bodyvar += $1<br />835,841d846
if $1 && (bodyvar.size&gt; 0) # Only create a temp file if necessary<br />> isFile = true
/Content-Disposition:.* name="?([^";]*)"?/ni.match(head)<br />870c887
isFile ? params[name].push(body) : params[name].push(bodyvar)<br />872c889
isFile ? params[name] = [body] : params[name] = [bodyvar]<br />1270c1287
body.concat hidden<br />1344c1361
buf.concat( attributes.delete("DOCTYPE") )<br />1349c1366buf.concat( doctype )<br />1353c1370
buf.concat( super(attributes){ yield } )<br />1355c1372buf.concat( super(attributes) )<br />1734c1751
methods.concat( methods.concat( methods.concat( methods.concat( methods.concat( methods.concat( methods.concat( methods.concat( methods.concat( extend TagMaker<br />> extend Html4Tr
methods.concat( methods.concat( eval "CGI_PARAMS = @params.nil? ? nil : @params.dup<br />> CGI_COOKIES = @cookies.nil? ? nil : @cookies.dup"
md5.hexdigest[0,32]<br />40c40,45
#id, = request.cookies[session_key]<br />> begin
so now I've rolled this change, and others into:
Back to RCRchive.
RCR Submission page and RCRchive powered by Ruby, Apache, RuWiki (modified), and RubLog
Creating temporary files for all the parts of a multi-part encoded form is pure silliness.
If there is some reason "it must be done" then at least you could only do it only for "large" objects.
Oh and they are "Tempfile" not "File" leading to issues when passed to libraries such as Ruby/GD.