Merge branch 'szzh' into develop
This commit is contained in:
commit
b389e6c77a
|
@ -1,5 +1,5 @@
|
||||||
|
require 'zip'
|
||||||
class ZipdownController < ApplicationController
|
class ZipdownController < ApplicationController
|
||||||
|
|
||||||
#查找项目(课程)
|
#查找项目(课程)
|
||||||
before_filter :find_project_by_bid_id, :only => [:assort]
|
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))
|
Dir.mkdir(File.dirname(zipfile_name)) unless File.exist?(File.dirname(zipfile_name))
|
||||||
|
|
||||||
Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile|
|
Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile|
|
||||||
input_filename.each do |filename|
|
input_filename.each do |filename|
|
||||||
rename_file = Time.now.to_i.to_s+ ic.iconv( (File.basename(filename)) ).to_s
|
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
|
rename_file = ic.iconv( filename_to_real( File.basename(filename))).to_s if is_attachment
|
||||||
|
|
||||||
zipfile.add(rename_file, filename)
|
zipfile.add(rename_file, filename)
|
||||||
|
|
Loading…
Reference in New Issue