2

PHP 5.4 introduce a new feature to track file upload. this feature is

$_SESSION upload_progress.

We have to enable it via php.ini.

Though I can't find any place in my php.ini to enable this option. What's the problem?

My php version is 5.4.

1 Answer 1

2

You need to add these params to your php.ini file.

session.upload_progress.enabled = on
session.upload_progress.prefix = "upload_progress_"
session.upload_progress.name = "blabla"

Check this <form>

<form action="upload.php" method="POST" enctype="multipart/form-data">
 <input type="hidden" name="<?php echo ini_get("session.upload_progress.name"); ?>" value="blabla" />
 <input type="file" name="file1" />
 <input type="file" name="file2" />
 <input type="submit" />
</form>

and on your PHP..

<?php
$_SESSION["upload_progress_blabla"] = array(
 "start_time" => 1234567890,   // The request time
 "content_length" => 57343257, // POST content length
 "bytes_processed" => 453489,  // Amount of bytes received and processed
 "done" => false,              // true when the POST handler has finished, successfully or not
 "files" => array(

This is a mixture of information and taken from PHP Manual as well. You need to check out that seriously.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.