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

  • SEARCH
  • Home
  • 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 8484263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:20:00+00:00 2026-06-10T20:20:00+00:00

I’m uploading some files through the POST in iframe wrappers that might take an

  • 0

I’m uploading some files through the POST in iframe wrappers that might take an unusual amount of time to process.

And before I output the result to be captured by an onload event of iframe I want to let the user know somehow that the upload has finished, and now the processing has started.

Otherwise a user might be confused by the long waiting.

I was thinking to display an initial message, and then add another line once done, and then compare the contents of the outputted page in iframe. But this approach never works for some reason.

Example:

print 'processing started';
for ($i=0; $i < 10; $i++) { 
    echo '...still processing';
    sleep(1);
}
echo 'done';

(Expecting to see the ‘processing started’ message, and ‘done’ once it has finished loading, but it just spits it out in one burst after 10 seconds of waiting).

So I wonder how can this be done?

Another thought I had, is to set a redirection header right in the beginning of the page, so once the file was uploaded it would redirect to some other page, where it would do the processing. Then try to capture the redirect and final response.

But that is kind of weird way, it would also need to pass the submitted parameters and move the uploaded files somewhere from the temporary folder, so they will not be deleted once the php script has been outputted.

…So I wonder if there is any better approach of doing what I am trying to do?

  • 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-10T20:20:02+00:00Added an answer on June 10, 2026 at 8:20 pm

    When the file has finished uploading, your PHP will get called so that you can (a) put the file where you want it, (b) issue some HTML to the browser in response and (c) in your case, start the processing.

    So what I’d do is save the file, and then start the processing as a background job on the server (run a separate PHP script using the command line PHP started via one of the system calls like exec). Give the job a unique ID which you can (a) create a temporary file named according to the ID, (b) pass to the browser somewhere in the HTML to we can query if the file still exists; and (c) when the job finishes, it removes that file, so we know it has completed.

    Now the HTML page in response to the upload can say “finished uploading, processing started” and then run some Javascript which polls the server (using Ajax – dead easy in jQuery, not too hard using XMLHttpRequest directly) asking if the job has finished (identifying the job by the query string in the URL of the polled request). The poll script on the server looks to see if the relevant file is still there and if so says “no, still working” or “yes, done” accordingly.

    If there is a way for the job to tell how far through it is, e.g. if you are working through the uploaded file in sequence, you could have the job write the progress percentage to the file periodically and return that in response to the poll, and at the client side display that as a progress bar.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have thousands of HTML files to process using Groovy/Java and I need to
I'm trying to create an if statement in PHP that prevents a single post
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into

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.