11

Possible Duplicate:
Upload Progress Bar in PHP

Can anyone suggest a good and easy way to include the file upload progress bar, while uploading a file. I know it would be a mix of javascript & php. Please suggest one

3
  • I have often wondered this. I have always used a Flash solution before like Uploadify. I have tried with jQuery, but it failed when trying to use two Ajax requests. I have found Flash solutions unreliable though, especially in IE. No surprise there. Commented Aug 31, 2010 at 19:52
  • Forget about javascript for that. Flash is unfortunatelly the ideal solution for now Commented Aug 31, 2010 at 19:53
  • 1
    This question has already been asked a few times: stackoverflow.com/questions/849237/upload-progress-bar-in-php stackoverflow.com/questions/653063/… Commented Aug 31, 2010 at 19:58

6 Answers 6

1

I like uploadify. Its very easy to implement and does the job perfectly.

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

4 Comments

yes I like the uploadify and currently using it for showing the upload progress. Its a good and neat one. I am trying it another way so that I can simply do the job with less files and more control over the design as I am not so fit with the swf flash stuffs. Also I have a doubt whether I can do the video encoding while uploading the video files through uploadify with ffmpeg
Sure you can. Once the file is on the server it changes nothing how it got there. And javascript solutions would have to be tested on internet explorer. Good luck with that. :)
thanks, have you had an idea of sample encoding technique other than ffmpeg to convert the video files into .flv .mp4 and .avi format. Cause the current hosting account of mine is not supporting the ffmpeg format
NOthing except using something like esternal services that do this for you. Even store the videos. Amazon S3 comes to mind.
1

http://valums.com/ajax-upload/

I chanced upon this recently and really liked it.

2 Comments

It doesn't seem to have a progress bar, though.
The title says with Progress Bar. Am not sure though.
0

SWFUpload

SWFUpload is a JavaScript Library that wraps the Flash Player's upload function. It brings your uploads to the next level with Multiple File Selection, Upload Progress and Client-side File Size Checking.

3 Comments

Well... not really: It works differently from a normal form-based file upload. You can't just put it into a normal file upload form and show a progress bar, which I think the OP is looking for. (If not, SWFUpload is a great choice!)
yes I am, but I also want this simple form with progress bar after upload it will encode the content to other formats like .flv .mp4 & .avi as I want this form to upload video
the swf upload is great but I dont go so deep as you said it may not be usefull in this specific case of encodeing video file after uploading
0

You'll have to check the size of the part of the file wich is allready on the Server, then get it on the Client per Ajax where you can paint the progress bar. (Remember to check the size of the hole Data before, to calculate the percantage ;-) )

4 Comments

So... you have to upload the file in order to know its size, and then jump back in time to show the progress bar? :)
right :-D No, you could read the filesize in the browser per JS bevore the upload...
that is not possible. There is no access to local files from JavaScript.
@Pekka It is possible in more modern browsers: developer.mozilla.org/en/…
0

I don't believe this is possible utilizing ajax. The only time you can get the complete file size is after upload and by then it's too late. '

If you utilize a flash-based uploader however, it is possible.

Comments

0

all "ajaxy" looking solutions use an swf object to do the upload job. you can home-cook your progressbar if you have an op-code cacher like APC

Here is Martin Jansen blogging about Rasmus Lerdorf's simple upload code which in the end uses APC

http://martinjansen.com/2007/04/28/file-upload-progress-bars-with-php/

and a working example

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.