Skip to content

Instantly share code, notes, and snippets.

@vijaydev
Created June 9, 2011 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vijaydev/1016552 to your computer and use it in GitHub Desktop.
Save vijaydev/1016552 to your computer and use it in GitHub Desktop.
if uploaded_file.instance_of?(Tempfile)
FileUtils.copy(uploaded_file.local_path, path_to_file)
else
File.open(path_to_file, "wb") { |f| f.write(uploaded_file.read) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment