Take the tour ×  The files are saved to public/data using:  def
upload_vault_data             if params[:dump][:file]
uploaded_io = params[:dump][:file]
File.open(Rails.root.join('public', 'data', "data_#{session[:cam
paign_id]}_#{uploaded_io.original_filename}"), 'w') do |file|
This works as expected, but how to let the user delete the file
once it has been uploaded?  share|improve this question add
comment  3 Answers  up vote 2 down vote accepted  Rails allows
you to execute system commands using the method called "system".
system 'ls'  More info here: Execute script with Ruby on Rails?
In your case, you can probably do a  system "rm #{path-to-my-
file}" share|improve this answer Exactly what I was looking for,
and it worked! –  iamtoc Oct 6 '12 at 9:11 But as Ryan has
mentioned, there are many elegant solutions available to handle
file uploads. You should definitely check them out... –  Vibhor
Mahajan Oct 7 '12 at 15:01 add comment  I would recommend
looking at using something such as dra