Created
October 17, 2012 12:18
-
-
Save davesherratt/3905237 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def upload | |
ajax_upload = params[:qqfile].is_a?(String) # either a file name (set) or a file (NOT SET, but qqFileUploader allows for it) | |
filename = ajax_upload ? params[:qqfile] : params[:qqfile].original_filename | |
if ajax_upload | |
csv_source = request.body.read | |
else | |
csv_source = params[:qqfile].read | |
end | |
tmp_file = "#{Rails.root}/data/tmp-#{cookies[:remember_token]}.csv" | |
csv_valid = false | |
parsed_csv = CSV.parse(csv_source) | |
if parsed_csv | |
csv_valid = true | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment