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[:campaign_id]}_#{uploaded_io.original_filename}"), 'w') do |file|
file.write(uploaded_io.read)
end
end
end
This works as expected, but how to let the user delete the file once it has been uploaded?
Rails allows you to execute system commands using the method called “system”.
eg.
More info here: Execute script with Ruby on Rails?
In your case, you can probably do a