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 46227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:55:59+00:00 2026-05-10T15:55:59+00:00

I want to upload and then process a file in a Ruby on Rails

  • 0

I want to upload and then process a file in a Ruby on Rails app. The file upload is usually quite short, but the server-side processing can take some time (more than 20 seconds) so I want to give the user some indicator – something better than a meaningless ‘processing…’ screen.

I’m trying to use the following code in the view

<%= periodically_call_remote(:url => {:action => 'progress_monitor', :controller => 'files'},                  :frequency => '5',                  :update => 'setProgress('progressBar','5')'                  ) %> 

The content of the :update parameter is the javascript I want to run every 5 seconds

and the following code is in the files controller

def progress_monitor   render :text => 'whatever' end 

Eventually the progress_monitor method will return the current progress as an integer (% complete) and that will be passed into the ‘setProgress’ JavaScript code (that will update an on screen element)

However, I’m struggling to get a correct response from from the server that can then be passed into JavaScript.

Can anyone help, or am I approaching this the wrong way?

There is a follow up question to this, I originally updated this question but the update was sufficiently different to warrant a new question, here.

  • 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. 2026-05-10T15:55:59+00:00Added an answer on May 10, 2026 at 3:55 pm

    periodically_call_remote() updates a div. It won’t call your JavaScript function. I’m no JavaScript guru, but to solve your problem, you should do your own xmlhttp call. If I were you, I’d use prototype’s AJAX request

    http://www.prototypejs.org/api/ajax/request

    and use JavaScript’s settimeout or setinterval to do the periodic polling

    http://www.elated.com/articles/javascript-timers-with-settimeout-and-setinterval/

    hope this helps cos actually I’ve encountered the same prb too =)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 83k
  • Answers 83k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer start MessageBox.vbs ...where MessageBox.vbs contains a call to the MsgBox… May 11, 2026 at 4:48 pm
  • Editorial Team
    Editorial Team added an answer There is a list of clipboard manager tools at Wikipedia:… May 11, 2026 at 4:48 pm
  • Editorial Team
    Editorial Team added an answer PHP can handle unicode fine once you make sure to… May 11, 2026 at 4:48 pm

Related Questions

I have a very basic CSV file upload module working to bulk upload my
I have been tasked with creating a reusable process for our Finance Dept to
How do I launch an app and capture the output via stdout and maybe
What I want to achieve is this. I want to give the user the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.