Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8644219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:14:25+00:00 2026-06-12T12:14:25+00:00

The files are saved to public/data using: def upload_vault_data if params[:dump][:file] uploaded_io = params[:dump][:file]

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T12:14:27+00:00Added an answer on June 12, 2026 at 12:14 pm

    Rails allows you to execute system commands using the method called “system”.

    eg.

    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}"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a method I'm using to load saved game data from a file.
Our server is saving EXIF data to every file saved with imagejpeg() . As
I have a file with saved data that sometimes needs to be accessed, written
I inherited a data-storage which was using simple text-files to save documents. Documents had
I have the following .cs file; using System; using System.Collections.Generic; using Sitecore.Data; using Sitecore.Data.Items;
The script is in myusername/public_html/item/index.php code to save file: $filename = $_SERVER['DOCUMENT_ROOT'].'/../data/guestbook.txt'; $filehandle =
I am being sent text files saved in ISO 88591-1 format that contain accented
The webserver is serving responses with utf-8 encoding, all files are saved with utf-8
What you prefer about saving Webservice files in asp.net website(not websiteapplication). I saved WebService
I would like to run a script after files with certain extensions are saved

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.