Method: FileUploader#process_upload

Defined in:
lib/captured/file_uploader.rb

#process_upload(file) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/captured/file_uploader.rb', line 45

def process_upload(file)
  remote_name = Digest::MD5.hexdigest(file+Time.now.to_i.to_s) +  File.extname(file)
  growl("Processing Upload", "#{File.dirname(File.expand_path(__FILE__))}/../../resources/action_run.png")
  @uploader.upload(file)
  remote_path = @uploader.url
  puts "Uploaded '#{file}' to '#{remote_path}'"
  pbcopy remote_path
  growl("Upload Succeeded", "#{File.dirname(File.expand_path(__FILE__))}/../../resources/green_check.png")
  History.append(file, remote_path)
rescue => e
  puts e
  puts e.backtrace
  growl(e)
end