From: RayZ Date: 2002-09-07T00:44:30+09:00 Subject: cgi.rb replacing "0x0a" symbols with "0x0d 0x0a" ? Hi! I am new to ruby and lack of understanding -- Ruby 1.6.7 & Apache 2.0.40 on win2k -- When i trying to make simple file-uploader i have been confront with a problem [test.html] --------------
attach file:
-------------- then [test.rb] -------------- #!/ruby/bin/ruby require 'cgi' ... someFile, = cgi['attach_file'] data = someFile.read newFile = File.new(CustomDir + newFilename + extension, "w") newFile.write(data) newFile.close ... -------------- Binary file successfully written to the destination but replaced "0x0a" symbols with "0x0d 0x0a" ('\r'->'\r\n') Please, can anyone explain me - what's wrong? P.S. sorry for my bad english. not expirienced yet ;) __________________________________________________________________________ Andrew "RayZ" V Rumm