Jump to content

Upload progress bar


NLCJ

Recommended Posts

Hello,

I've been trying to create a progress bar for the past 3 days, but I can't get it to work. I've got my own dedicated server with cPanel on it, using cPanel I installed the PECL extension. However, it doesn't respond to anything. The script I'm using is:

HTML code:

<form id="uploadform" enctype="multipart/form-data" method="post">
					<input id="UPLOAD_IDENTIFIER" name="UPLOAD_IDENTIFIER" type="hidden" value="12345" />
					<input id="ulfile" name="ulfile" type="file" />
					<input type="submit" value="Upload" />
				</form>

To request the information I made another page with:

<?php print uploadprogress_get_info($_GET['id']); ?>

 

Nothing is returned however, no error, nothing... I'm totally lost!

 

Regards,

Link to comment
https://forums.phpfreaks.com/topic/222147-upload-progress-bar/
Share on other sites

The form gets an unique id, just for testing I set it manually:

<input id="UPLOAD_IDENTIFIER" name="UPLOAD_IDENTIFIER" type="hidden" value="12345" />

This field will tell the extension uploadprogress that the identifier for this upload is 12345. Then you should be able to get it by using filename.php?id=12345:

<?php print uploadprogress_get_info($_GET['id']); ?>

However, it seems that no data is being made using this extension. I got no clue... :) Once I figured it out I will post it here.

 

Link to comment
https://forums.phpfreaks.com/topic/222147-upload-progress-bar/#findComment-1149511
Share on other sites

I found the problem, I think. When I couldn't solve it I was searching for the original docs of this extension. After a few broken links I found the examples at:

http://svn.php.net/viewvc/pecl/uploadprogress/tags/RELEASE_1_0_1/examples/

 

Copying and viewing those resulted in a page with the information about the current settings. A few of those are:

('upload_max_filesize' is 50M per file)

('post_max_size' is 8M per submit)

I was aware of the max filesize of 50M, so I uploaded files around 40M. Due to the post_max_size being 8M it wouldn't return any information. So I tried a 6M file with the example script, and it resulted in the wanted results! :)

Link to comment
https://forums.phpfreaks.com/topic/222147-upload-progress-bar/#findComment-1149514
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.