Over a million developers have joined DZone.

Uplaod files and images from you android to your desktop/laptop

·

 

#!/usr/bin/env ruby
# Author : Emad Elsaid (https://github.com/blazeeboy)
require 'sinatra'

set :port, 3000
set :environment, :production

get '/' do
	<<-EOT

	
	
Choose files
EOT end post '/upload' do params['files'].each do |f| tempfile = f[:tempfile] filename = f[:filename] FileUtils.copy(tempfile.path, "./#{filename}") end redirect '/' end
Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}