commit
6b67f5036c
|
@ -5,12 +5,11 @@ class ZipdownController < ApplicationController
|
|||
before_filter :find_project_by_bid_id, :only => [:assort]
|
||||
#检查权限
|
||||
#勿删 before_filter :authorize, :only => [:assort,:download_user_homework]
|
||||
SAVE_FOLDER = "#{Rails.root}/files"
|
||||
OUTPUT_FOLDER = "#{Rails.root}/files/archiveZip"
|
||||
MAX_PATH = 50
|
||||
## 200M
|
||||
MAX_DOWN_SIZE = 200 * 1024 * 1024
|
||||
|
||||
include ZipService
|
||||
|
||||
#统一下载功能
|
||||
def download
|
||||
if User.current.logged?
|
||||
|
@ -114,6 +113,4 @@ class ZipdownController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
include ZipService
|
||||
|
||||
end
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
require "base64"
|
||||
require 'zip'
|
||||
SAVE_FOLDER = "#{Rails.root}/files"
|
||||
OUTPUT_FOLDER = "#{Rails.root}/files/archiveZip"
|
||||
MAX_PATH = 50
|
||||
|
||||
module ZipService
|
||||
|
||||
SAVE_FOLDER = "#{Rails.root}/files"
|
||||
OUTPUT_FOLDER = "#{Rails.root}/files/archiveZip"
|
||||
MAX_PATH = 50
|
||||
|
||||
def zip_bid(bid)
|
||||
# Todo: User Access Controll
|
||||
bid_homework_path = []
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
#coding=utf-8
|
||||
|
||||
SAVE_FOLDER = "#{Rails.root}/files"
|
||||
OUTPUT_FOLDER = "#{Rails.root}/files/archiveZip"
|
||||
MAX_PATH = 50
|
||||
|
||||
namespace :zip do
|
||||
desc "手工打包作品"
|
||||
task :pack => :environment do
|
||||
|
|
Loading…
Reference in New Issue