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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:46:26+00:00 2026-05-13T22:46:26+00:00

I have an embedded iframe form which takes a file from a type=file form

  • 0

I have an embedded iframe form which takes a file from a type=”file” form field and uploads it using a progress bar:

<form action="sell_upload.php" method="post" id="uploadform" enctype="multipart/form-data">
    <input type="hidden" name="UPLOAD_IDENTIFIER" id="progress_key" value="<?= $uuid ?>" /> 
    <input type="hidden" name="uploaded" value="yes" />    
    <input type="hidden" name="MAX_FILE_SIZE" value="2097152" />        
    <input type="file" name="ulfile1" id="ulfile1"  onChange="beginUploadNew();"/>

beginUploadNew() is executed on submit(which is shortcutted to onChange [instead of clicking submit]):

function beginUploadNew(){
$('#uploadform').submit();  
$("#uploadprogressbar").fadeIn();
progress_key= $("#progress_key").val();
alert (progress_key);
var i = setInterval(function() 
{ 
    $.getJSON("uploadprogress.php?id=" + progress_key, function(data) 
    {
        if (data == null) 
        {
            clearInterval(i);
            location.reload(true);
            //alert ("oh noes2");
            return;
        }
        //alert ("oh noes3");
        //alert (parseInt(data.bytes_total));
        var percentage = Math.floor(100 * parseInt(data.bytes_uploaded) / parseInt(data.bytes_total));
        $("#uploadprogressbar").progressBar(percentage);
    });

}, 1000);
return true;}

The PROBLEM:
Sometimes(usually the first time that i press that submit button) it seems that everything is going ok, the loading bar fades in, just as the script is written, then abruptly reloads the page as it nothing has happened. I’m uploading 1.5 meg pictures for testing, and there is certainly not enough time to have passed for it to have uploaded.

And Sometimes it uploads just fine.

Any suggestion? I am definitely waiting long enogh for both the main page and the iframe to load, so that shouldn’t be that issue.

Thanks,
Jason

  • 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-05-13T22:46:26+00:00Added an answer on May 13, 2026 at 10:46 pm

    data == null looks risky. if You return something ill-formed in the php it will return true and end displaying preloader. Try:

    1. watching what is being returned before upload starts and when it’s at 0%
    2. returning explicitly some ending or watching for 100% etc. so that You don’t stop displaying progress bar when php returns non-JSON text
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, I have an iframe embedded in a page and the iframe has some
If I have an embedded browser in a windows form, is it possible to
I have the following embedded iframe <iframe width=100% height=400 src=reallylongpage.html /> reallylongpage.html has 2
I have an iframe embedded on my webpage and I'd like to edit certain
I have a parent document with an embedded iframe. Inside the iframe I have
I have embedded a Python interpreter in a C program. Suppose the C program
I have an embedded webserver that has a total of 2 Megs of space
I have an embedded PowerPoint presentation in an Excel workbook. How can I edit
I have an embedded flash that is transparent so it looks like part of
We have an embedded device that needs to interact with an enterprise software system.

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.