Jump to content


Photo

Uploading files with progress bar


  • Please log in to reply
2 replies to this topic

#1 rshadarack

rshadarack
  • Members
  • PipPip
  • Member
  • 29 posts

Posted 15 March 2006 - 03:16 AM

Hi, I'm fairly new to php, but a fairly experience programmer. Finally found some time to get around to learning it and now I'm a bit mad I didn't start earlier. So far it's been a breeze.

As the title indicates, I'm trying to get a progress bar to show files while downloading. I'm using the code at:

[a href=\"http://www.devpro.it/upload_progress/\" target=\"_blank\"]http://www.devpro.it/upload_progress/[/a]

But I can't seem to get it to work. I pretty much copy and pasted all the files from the site, the only one which wasn't on there was the file that handled the actual moving of the file, index.php:

<?php
$uploaddir = '../upload/';
$uploadfile = $uploaddir . basename($_FILES['gfile']['name']);

echo '<pre>';
if (move_uploaded_file($_FILES['gfile']['tmp_name'], $uploadfile)) {
   echo "File is valid, and was successfully uploaded.\n";
} else {
   echo "Error!\n";
}

echo 'Here is some more debugging info:';
print_r($_FILES);

echo "</pre>";

?>

However, I am still running into problems. First of all (and I've had this problem with other uploading scripts), firefox displays "The script has stopped responding" when ever uploading larger files (seems to be around +300k). But this is really more an annoyance than a problem since after I stop the script, it goes to the page saying that the file upload was successful, and indeed, it does work. But also there is nothing that pops up to display the progress.

The files I have in my directory are:

BytesUploaded.js
index.php
LoadVars.js
test.php //this is the main file, I don't think the name of it matters, right?
UploadProgressManager.class.php
whileuploading.php

Any help would be much appreciated!

#2 keeB

keeB
  • Staff Alumni
  • Advanced Member
  • 1,078 posts
  • LocationCalifornia

Posted 15 March 2006 - 07:33 AM

Did you increase max execution time in the PHP.INI file?

Come visit my site to see my latest projects
http://nick.stinemates.org/wordpress/


#3 rshadarack

rshadarack
  • Members
  • PipPip
  • Member
  • 29 posts

Posted 15 March 2006 - 11:39 PM

Ah, ok, so that explains the problem with the script not responding.

But I still can't seem to get the progress bar to pop up.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users