Merge branch 'szzh' into develop

This commit is contained in:
sw 2014-09-13 16:08:02 +08:00
commit b389e6c77a
1 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
require 'zip'
class ZipdownController < ApplicationController
#查找项目(课程)
before_filter :find_project_by_bid_id, :only => [:assort]
#检查权限
@ -124,9 +124,9 @@ class ZipdownController < ApplicationController
Dir.mkdir(File.dirname(zipfile_name)) unless File.exist?(File.dirname(zipfile_name))
Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile|
input_filename.each do |filename|
rename_file = Time.now.to_i.to_s+ ic.iconv( (File.basename(filename)) ).to_s
Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile|
input_filename.each do |filename|
rename_file = Time.now.to_i.to_s+ ic.iconv( (File.basename(filename)) ).to_s
rename_file = ic.iconv( filename_to_real( File.basename(filename))).to_s if is_attachment
zipfile.add(rename_file, filename)