pull in code from railscast for jquery-file-upload