Sha256: ce967acecc932d7c42d7bb9b28c0cbe9981aaaa5b98ac248b61f7833e06eebb8
Contents?: true
Size: 641 Bytes
Versions: 14
Compression:
Stored size: 641 Bytes
Contents
require 'rubygems' require 'ramaze' class Upload < Ramaze::Controller def index return unless request.post? @inspection = h(request.params.pretty_inspect) tempfile, filename, @type = request[:file].values_at(:tempfile, :filename, :type) @extname, @basename = File.extname(filename), File.basename(filename) @file_size = tempfile.size options = Upload.options dir = File.join(options.roots.first, options.publics.first) file = File.expand_path(@basename, dir) FileUtils.mkdir_p(dir) FileUtils.cp(tempfile.path, file) @is_image = @type.split('/').first == 'image' end end Ramaze.start
Version data entries
14 entries across 14 versions & 1 rubygems