Does anyone know how can I use the flush() methode to show the user the elapsed time during the file upload?

Background:
I have a galerie where any administrativ User can upload files. These filesizes could be upper then 1 or more MB. Now the user cancel the window because they think that the server reached the time out.

thx in advance

    Have you googled "PHP upload progress bar"?

      4 months later

      googling that subject is SO DEPRESSING. c'mon PHP! gimme a progress bar!

        Hmm, I've heard of makeshoppingcart(), but that's a tad ridiculous, don't ya think....? 😃

          ok so i misspoke. however, the other threads on this subject in these forums seem to indicate that it's IMPOSSIBLE to make your own progress bar with PHP. there is no way to determine the FINAL SIZE of a file upload within PHP and there is no PHP routine to keep the user updated of a file upload in progress.

          the best attempts people seem to be making are:
          opening a separate window that refreshes itself periodically, calling a separate PHP page that checks the filesize of a TMP file which corresponds to the upload. that's a rather obnoxious workaround and far from satisfactory.

            Well, I was joking, 'cause I assumed that you were ... or else were just crying 'waah, waah, where's my binky?' like a toddler .... 😉 I'd really hoped for the former...

            PHP can draw dynamic images on the fly from the server; determine file sizes on the server; and it can send information from the server to the client. Now, do you know if PHP is server-side or client-side? 🙂

            The "best attempts" are attempts to assuage people who don't want to learn client-side multi-language solutions, which are the thing(s) currently needed for this scenario. I can't say why PHP doesn't have the capacity to deal directly with raw POST data; I didn't design it or write it, and I doubt that I could have....

            But hope is not lost! Have you heard of Megaupload? To create this masterpiece, a few smart guys had to use PHP, Javascript, and CGI Perl :eek: (and of course a 'lil HTML). It's real time AFAIK, but I've not given it a lot of study (and it would take a bit). I think that it is as close as you can get to what I think you're asking for, unless you want a Java (not just Javascript) applet or ActiveX script that only works with IE (most likely) which was what I heard the ASP solution was sometime back....

            HTH 🙂

              All I said was true .... HTML source, indeed, "jar.jar"!!

                waaAAAHHH!

                i was half jesting, but the pangs of tantrum were there.

                oooooo....megaupload....there's a typo in your link but i am familiar with sourceforge. love love love 'em. downloading now.

                that's more like it! i have no PERL, JAVA, or ACTIVEX coding abilities to speak of. i'm fairly good at javascript/dhtml, but as far as i know, there's no way to get the size of a file being selected for upload...the image object has no such property as filesize.

                also, my server here is a bit austere...not sure of XML, JAVA, ACTIVEX, or other beasties can be served at all. sorry for newbiness, THANKS for the megaupload tip. what took ya so long!

                😉

                  Write a Reply...