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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:35:06+00:00 2026-06-07T17:35:06+00:00

I am trying to create an upload progress bar with PHP. I saw the

  • 0

I am trying to create an upload progress bar with PHP.
I saw the new feature of PHP 5.4: upload progress session.

This is my HTML code:

<form id="upload" action="ajax/progress.php" method="POST" enctype="multipart/form-data">
    <input type="hidden" name="<?php echo ini_get("session.upload_progress.name"); ?>" value="dupload" />
    <input id="file1" type="file" name="file1" />
    <input class="btn primary" type="submit" value="Upload" />
</form>

And this is progress.php:

<?php
session_start();

$key = ini_get("session.upload_progress.prefix") . 'dupload';

if (!empty($_SESSION[$key])){
    $current = $_SESSION[$key]["bytes_processed"];
    $total = $_SESSION[$key]["content_length"];
    echo $current < $total ? ceil($current / $total * 100) : 100;
}
else {
    var_dump($_SESSION);
    var_dump($_FILES);
}

AJAX:

$('#upload').submit(function () {
    interval_id = setInterval(function () {
        $.ajax({
            url: "ajax/progress.php6",
            type: "POST",
            success: function (data) {
                console.log(data);
            }
        });
    }, 200);
    return false;
});

All the ini settings are right. (session is enabled, name and prefix is right)

I am always getting an empty session array. What’s wrong?

Thanks!

  • 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-07T17:35:07+00:00Added an answer on June 7, 2026 at 5:35 pm

    Wasn’t able to sort it out so I used XMLHTTPREQUEST “progress” action and that worked well.
    Thanks!

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

Sidebar

Related Questions

I am trying to create an HTML link that changes the PHP session id.
I am trying to create a PHP file to upload images to my website.
I am trying to upload a file with playframework. I create a form and
I am trying to create a upload form using servlets, and so far i
I'm trying to create a simple file upload form for my website. I'm using
I'm trying to create an upload file, and email as an attachment form where
I'm trying to create a form where users can save their progress. I have
I've been trying to create a non-flash upload panel which also shows a progress
I am trying to create an ajaxy file upload. Here is the asp code:
I'm trying to create new MyImage entitly as listed in How to upload and

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.