Class: FTPMVC::Filter::AsyncUpload

Inherits:
Base
  • Object
show all
Defined in:
lib/ftpmvc/filter/async_upload.rb

Instance Method Summary collapse

Instance Method Details

#put(path, input) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/ftpmvc/filter/async_upload.rb', line 9

def put(path, input)
  return super if input.kind_of?(FTPMVC::Async::Upload::Input)
  SecureRandom.uuid.tap do |id|
    file(id).write do |out|
      input.read { |chunk| out.write(chunk) }
    end
    Resque.enqueue(FTPMVC::Async::Upload.config.job, path, id)
  end
end