aastring = "public/images/"+Time.now.strftime("%y-%m-%d")+(file.original_filename)
File.open(aastring,"wb+") do |f|
f.write(file.read)
render(:text=>"afterupload :"+aastring+"上传成功!!!")
end
Another security issue you should care for is the file names (see Ruby On Rails Security Guide). By default, CarrierWave provides only English letters, arabic numerals and '-+_.' symbols as white-listed characters in the file name. If you want to support local scripts (Cyrillic letters, letters with diacritics and so on), you have to override sanitize_regexp method. It should return regular expression which would match all non-allowed symbols.
With Ruby 1.9 and higher you can simply write (as it has Oniguruma built-in):