0

I realize this has been asked a few times but I can't find a solution that works for me.

Note: my webhost does NOT support APC.

Here's what I currently have working:

I have an HTML form with a text box to enter some text, and a button to select a file to upload. Once a button with a 'submit' type is clicked the text and file are POSTED to a PHP script which uploads the file and enters some information into a database.

All of the solutions I'm finding seem to be overkill. All I really need is the HTML form to display a progress bar once the file starts getting uploaded via the PHP script. Also, I need everything else in the script (database entries, etc) to continue to function normally.

Is there something simple I can add to my code to achieve this?

Thanks!

user1539281
  • 53
  • 1
  • 7

2 Answers2

1

You may try AXUPLOADER 2.0 which has got a progress bar.

Hope this helps...

Alfred
  • 21,058
  • 61
  • 167
  • 249
0

Try this PHP/Javascript Make a form page and set the action to uploader.php

<html>
<head>
<script>
function trackUploadProgress(){
    var upload = document.getElementById('file');
    var uploadSize =   upload.getFileSize('1024' , int);
    <?php
    $file = $_FILES['tmp_name']['file'];
    $filesize =  $file.filesize(1024);

    ?>
    var   progress  = uploadSize * 100 / document.getElementById('file_full').value;
    var prog = document.getElementById('prog');
    prog.value == progress;
}
</script>
</head>
<body>
<!-- Your design!-->
<p id="prog"></p>
<?php echo '<p id="file_full">' . $filesize . '</p>';?>

This should do the trick with no external libraries

user3343456
  • 103
  • 2
  • 9
  • The script ending tag is missing and the p element in the javascript block seems to be wrong placed. – CSchulz Feb 23 '14 at 19:55