0

So here is what I want in short:

  • A PHP/Javascript/AJAX based File Uploader with a Progress bar what shows the percent(ex: 52%) and <div> what grows in width as the upload goes on.

And in long:

I would like a solution written in PHP and Javascript(Not jQuery), I tried myself but in server side I can't get the file size of the uploading file so I can't calculate the remaining percent.

Maybe there is a way to do it normally but I didn't find any clear ways. What I found is a lots of PHP patches what didn't worked :\ .

At last I tried Uber Uploader what uses Perl, I installed correctly but when I try to upload a file the progress bar is not shown, there are no errors just doesn't works :(.

However I don't really like to use such solutions because it's really messy even if it works, I like to write my own code if it's possible but I don't find any solution yet.

Also there are flash uploaders like pixeline and swfupload , but as I sayed I would like to use PHP and Javascript.

2
  • please point out why the many already existing Q&As on SO regarding that topic do not help you solve that task. And please give reference to questions you have already checked, so we know you did your homework before asking. Commented Jan 6, 2011 at 16:53
  • On a sidenote, PHP.next will have native upload progress bar support. There is already also PECL extension available. Commented Jan 6, 2011 at 16:59

3 Answers 3

1

You should use the UploadProgress extension, along with a jQuery AJAX request that updates your progress bar according to the reply, every x milliseconds.

Here's the link to the extension: http://pecl.php.net/package/uploadprogress/

Alternatively, it can also be done with APC.

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

2 Comments

Hi! Thanks for you answer, I tried both of them earlier but I can't figure out how to make them work, for the uploadprogress when I open the example file says me that The uploadprogress extension is not installed. how should I install it?, And APC Asks for a file what's not included in the downloaded file :/
See this page on how to install extensions: php.net/manual/en/install.pecl.php
0

The file size can be obtained when you access the directory or folder of the file and this may be requested separately or when opening the file depending on the language you eventually use. The progress bar types are legally protected items and they have rules for indicating the progress in different ways visually and some are licensable from major suppliers but there are some freeware or shareware versions which may operate on a compatible operating system when allowed.

1 Comment

Sometimes the method of drawing the bar or block extension on the computer display is not available to other operating systems and that is why they do not appear to show anything
0

PHP completely processes file uploads before passing control back to the page.

This creates a problem.

The only real PHP solution I know of involves the use of APC, which adds a hook to PHP that you can access via a second PHP script over AJAX.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.