Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #12769 > unrolled thread

Upload not working on adding progress bar script in HTML file

Started bySaikat Saha <saikat.saha5@gmail.com>
First post2014-02-10 20:22 -0800
Last post2014-02-12 06:35 -0500
Articles 12 — 7 participants

Back to article view | Back to comp.lang.php


Contents

  Upload not working on adding progress bar script in HTML file Saikat Saha <saikat.saha5@gmail.com> - 2014-02-10 20:22 -0800
    Re: Upload not working on adding progress bar script in HTML file Jerry Stuckle <jstucklex@attglobal.net> - 2014-02-10 23:41 -0500
    Re: Upload not working on adding progress bar script in HTML file Michael Vilain <vilain@NOspamcop.net> - 2014-02-10 21:23 -0800
      Re: Upload not working on adding progress bar script in HTML file Jerry Stuckle <jstucklex@attglobal.net> - 2014-02-11 08:26 -0500
    Re: Upload not working on adding progress bar script in HTML file Norman Peelman <npeelman@cfl.rr.com> - 2014-02-11 07:27 -0500
      Re: Upload not working on adding progress bar script in HTML file Scott Johnson <noonehome@chalupasworld.com> - 2014-02-11 05:02 -0800
        Re: Upload not working on adding progress bar script in HTML file Christoph Michael Becker <cmbecker69@arcor.de> - 2014-02-11 14:18 +0100
      Re: Upload not working on adding progress bar script in HTML file Jerry Stuckle <jstucklex@attglobal.net> - 2014-02-11 09:29 -0500
    Re: Upload not working on adding progress bar script in HTML file Christoph Michael Becker <cmbecker69@arcor.de> - 2014-02-11 13:48 +0100
      Re: Upload not working on adding progress bar script in HTML file Salvatore <sal@yojimbo.hack.invalid> - 2014-02-12 04:25 +0000
    Re: Upload not working on adding progress bar script in HTML file Saikat Saha <saikat.saha5@gmail.com> - 2014-02-11 20:50 -0800
      Re: Upload not working on adding progress bar script in HTML file Jerry Stuckle <jstucklex@attglobal.net> - 2014-02-12 06:35 -0500

#12769 — Upload not working on adding progress bar script in HTML file

FromSaikat Saha <saikat.saha5@gmail.com>
Date2014-02-10 20:22 -0800
SubjectUpload not working on adding progress bar script in HTML file
Message-ID<5d8ba92b-6d39-4d51-ad90-eef3bbfdf8f7@googlegroups.com>

I am creating an app where I need to upload file using HTML input type="file" to a PHP server,when I upload the file to the PHP link without progress bar its working fine but when i add progress bar count script using ajaxform its unable to upload the file to the PHP server while this progress bar code works fine for this online test server, http://posttestserver.com/post.php.

I am not getting what is the actual issue as I am not aware of PHP code and my friend is not aware of HTML code,my friend is saying there is nothing to do from his end as it is working fine without progress bar script. I had tried all possible progress bar script available in the web.please help me out how to solve it with progress bar count.

[toc] | [next] | [standalone]


#12770

FromJerry Stuckle <jstucklex@attglobal.net>
Date2014-02-10 23:41 -0500
Message-ID<ldc9lp$ss$1@dont-email.me>
In reply to#12769
On 2/10/2014 11:22 PM, Saikat Saha wrote:
>
>
> I am creating an app where I need to upload file using HTML input type="file" to a PHP server,when I upload the file to the PHP link without progress bar its working fine but when i add progress bar count script using ajaxform its unable to upload the file to the PHP server while this progress bar code works fine for this online test server, http://posttestserver.com/post.php.
>
> I am not getting what is the actual issue as I am not aware of PHP code and my friend is not aware of HTML code,my friend is saying there is nothing to do from his end as it is working fine without progress bar script. I had tried all possible progress bar script available in the web.please help me out how to solve it with progress bar count.
>

I have to agree with your friend.  If it's working without the progress 
bar, it's probably not a PHP problem.

However, you also haven't provided sufficient information for any more 
assistance.  For instance - did you change any PHP code from the working 
to the non-working version?  Do you get any errors - either at the 
browser (javascript) or the server (php)?  Are you sure the scripts 
you're using work with the server's version of PHP?  What are the 
differences between the test and production servers (i.e. PHP versions, 
operating system, etc.)?

Lots of unknowns here.  You need to do some debugging to see just where 
the problem lies.  The answers to these questions should help you know 
where to start looking.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#12771

FromMichael Vilain <vilain@NOspamcop.net>
Date2014-02-10 21:23 -0800
Message-ID<vilain-660795.21235310022014@news.individual.net>
In reply to#12769
In article <5d8ba92b-6d39-4d51-ad90-eef3bbfdf8f7@googlegroups.com>,
 Saikat Saha <saikat.saha5@gmail.com> wrote:

> I am creating an app where I need to upload file using HTML input type="file" 
> to a PHP server,when I upload the file to the PHP link without progress bar 
> its working fine but when i add progress bar count script using ajaxform its 
> unable to upload the file to the PHP server while this progress bar code 
> works fine for this online test server, http://posttestserver.com/post.php.
> 
> I am not getting what is the actual issue as I am not aware of PHP code and 
> my friend is not aware of HTML code,my friend is saying there is nothing to 
> do from his end as it is working fine without progress bar script. I had 
> tried all possible progress bar script available in the web.please help me 
> out how to solve it with progress bar count.

In order to actually track the progress of the download, you're going to 
have to do all the heavy lifting that the browser and server is doing 
for you.  Most likely this would be a java applet that you'd have to 
write.  If you think about it, the server has to has no knowledge of the 
byte stream being sent to it by the browser.  It's my understanding that 
if you send the actual length of the file to be transferred down to the 
browser, it can display a progress bar.  

The reverse is not true.  If you use the <input> tag, there's no 
provision to tell the server in the tag how long the transfer would be.  
And once it starts sending the file, the server can't communicate with 
the browser until it's complete.

If this is a *must have*, I'd look at other tools besides php to 
transfer a file with a progress bar.  You'll most likely have to code it 
by hand.

A quick and dirty workaround is to unhide an animated GIF of clock hands 
or rotating dots or whatever but it won't have any correlation to what's 
being transferred. But it will give the user feedback that something is 
happening.

-- 
DeeDee, don't press that button!  DeeDee!  NO!  Dee...
[I filter all Goggle Groups posts, so any reply may be automatically ignored]

[toc] | [prev] | [next] | [standalone]


#12783

FromJerry Stuckle <jstucklex@attglobal.net>
Date2014-02-11 08:26 -0500
Message-ID<ldd8dr$m80$1@dont-email.me>
In reply to#12771
On 2/11/2014 12:23 AM, Michael Vilain wrote:
> In article <5d8ba92b-6d39-4d51-ad90-eef3bbfdf8f7@googlegroups.com>,
>   Saikat Saha <saikat.saha5@gmail.com> wrote:
>
>> I am creating an app where I need to upload file using HTML input type="file"
>> to a PHP server,when I upload the file to the PHP link without progress bar
>> its working fine but when i add progress bar count script using ajaxform its
>> unable to upload the file to the PHP server while this progress bar code
>> works fine for this online test server, http://posttestserver.com/post.php.
>>
>> I am not getting what is the actual issue as I am not aware of PHP code and
>> my friend is not aware of HTML code,my friend is saying there is nothing to
>> do from his end as it is working fine without progress bar script. I had
>> tried all possible progress bar script available in the web.please help me
>> out how to solve it with progress bar count.
>
> In order to actually track the progress of the download, you're going to
> have to do all the heavy lifting that the browser and server is doing
> for you.  Most likely this would be a java applet that you'd have to
> write.  If you think about it, the server has to has no knowledge of the
> byte stream being sent to it by the browser.  It's my understanding that
> if you send the actual length of the file to be transferred down to the
> browser, it can display a progress bar.
>
> The reverse is not true.  If you use the <input> tag, there's no
> provision to tell the server in the tag how long the transfer would be.
> And once it starts sending the file, the server can't communicate with
> the browser until it's complete.
>

No, before the file upload starts, the browser sends the file size to 
the server.  And they CAN communicate; see the APC PECL extension.

> If this is a *must have*, I'd look at other tools besides php to
> transfer a file with a progress bar.  You'll most likely have to code it
> by hand.
>

It can easily be done with the APC extension and some javascript.

> A quick and dirty workaround is to unhide an animated GIF of clock hands
> or rotating dots or whatever but it won't have any correlation to what's
> being transferred. But it will give the user feedback that something is
> happening.
>


-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#12776

FromNorman Peelman <npeelman@cfl.rr.com>
Date2014-02-11 07:27 -0500
Message-ID<ldd50f$1t4$1@dont-email.me>
In reply to#12769
On 02/10/2014 11:22 PM, Saikat Saha wrote:
>
>
> I am creating an app where I need to upload file using HTML input type="file" to a PHP server,when I upload the file to the PHP link without progress bar its working fine but when i add progress bar count script using ajaxform its unable to upload the file to the PHP server while this progress bar code works fine for this online test server, http://posttestserver.com/post.php.
>
> I am not getting what is the actual issue as I am not aware of PHP code and my friend is not aware of HTML code,my friend is saying there is nothing to do from his end as it is working fine without progress bar script. I had tried all possible progress bar script available in the web.please help me out how to solve it with progress bar count.
>

http://www.php.net/manual/en/session.upload-progress.php

-- 
Norman
Registered Linux user #461062
-Have you been to www.php.net yet?-

[toc] | [prev] | [next] | [standalone]


#12780

FromScott Johnson <noonehome@chalupasworld.com>
Date2014-02-11 05:02 -0800
Message-ID<ldd75q$ck5$1@dont-email.me>
In reply to#12776
On 2/11/14, 4:27 AM, Norman Peelman wrote:
> On 02/10/2014 11:22 PM, Saikat Saha wrote:
>>
>>
>> I am creating an app where I need to upload file using HTML input
>> type="file" to a PHP server,when I upload the file to the PHP link
>> without progress bar its working fine but when i add progress bar
>> count script using ajaxform its unable to upload the file to the PHP
>> server while this progress bar code works fine for this online test
>> server, http://posttestserver.com/post.php.
>>
>> I am not getting what is the actual issue as I am not aware of PHP
>> code and my friend is not aware of HTML code,my friend is saying there
>> is nothing to do from his end as it is working fine without progress
>> bar script. I had tried all possible progress bar script available in
>> the web.please help me out how to solve it with progress bar count.
>>
>
> http://www.php.net/manual/en/session.upload-progress.php
>

Hmm.

This is an interesting idea that I did not know about.  Will surely have 
to give it a try at some point.

Scotty

[toc] | [prev] | [next] | [standalone]


#12782

FromChristoph Michael Becker <cmbecker69@arcor.de>
Date2014-02-11 14:18 +0100
Message-ID<52fa2316$0$6656$9b4e6d93@newsspool2.arcor-online.net>
In reply to#12780
Scott Johnson wrote:

> On 2/11/14, 4:27 AM, Norman Peelman wrote:
>
>> http://www.php.net/manual/en/session.upload-progress.php

> 
> Hmm.
> 
> This is an interesting idea that I did not know about.  Will surely have
> to give it a try at some point.

An alternative to this are chunked uploads, as used by plupload[1], for
instance.

[1] <http://www.plupload.com/>

-- 
Christoph M. Becker

[toc] | [prev] | [next] | [standalone]


#12787

FromJerry Stuckle <jstucklex@attglobal.net>
Date2014-02-11 09:29 -0500
Message-ID<lddc4q$crf$2@dont-email.me>
In reply to#12776
On 2/11/2014 7:27 AM, Norman Peelman wrote:
> On 02/10/2014 11:22 PM, Saikat Saha wrote:
>>
>>
>> I am creating an app where I need to upload file using HTML input
>> type="file" to a PHP server,when I upload the file to the PHP link
>> without progress bar its working fine but when i add progress bar
>> count script using ajaxform its unable to upload the file to the PHP
>> server while this progress bar code works fine for this online test
>> server, http://posttestserver.com/post.php.
>>
>> I am not getting what is the actual issue as I am not aware of PHP
>> code and my friend is not aware of HTML code,my friend is saying there
>> is nothing to do from his end as it is working fine without progress
>> bar script. I had tried all possible progress bar script available in
>> the web.please help me out how to solve it with progress bar count.
>>
>
> http://www.php.net/manual/en/session.upload-progress.php
>

Interesting - they finally implemented this in base PHP.

I admit I didn't pay a lot of attention to it as I've been using APC for 
quite a while and wasn't looking for anything else.


-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#12778

FromChristoph Michael Becker <cmbecker69@arcor.de>
Date2014-02-11 13:48 +0100
Message-ID<52fa1c25$0$6663$9b4e6d93@newsspool2.arcor-online.net>
In reply to#12769
Saikat Saha wrote:

> I am creating an app where I need to upload file using HTML input
> type="file" to a PHP server,when I upload the file to the PHP link
> without progress bar its working fine but when i add progress bar
> count script using ajaxform its unable to upload the file to the PHP
> server while this progress bar code works fine for this online test
> server, http://posttestserver.com/post.php.
> 
> I am not getting what is the actual issue as I am not aware of PHP
> code and my friend is not aware of HTML code,my friend is saying
> there is nothing to do from his end as it is working fine without
> progress bar script. I had tried all possible progress bar script
> available in the web.please help me out how to solve it with progress
> bar count.

It seems your problems are more related to the client-side library you
are using.  You should consider asking in a related newsgroup/forum (the
more specific, the better).

-- 
Christoph M. Becker

[toc] | [prev] | [next] | [standalone]


#12801

FromSalvatore <sal@yojimbo.hack.invalid>
Date2014-02-12 04:25 +0000
Message-ID<ldet35$1gph$1@news.tokachu.com>
In reply to#12778
On 2014-02-11, Christoph Michael Becker <cmbecker69@arcor.de> wrote:
> It seems your problems are more related to the client-side library you
> are using.  You should consider asking in a related newsgroup/forum (the
> more specific, the better).

I would have to agree. Technically, it is possible to track a file
upload to a PHP server without using any PHP. (There is a new JavaScript
interface to track the upload progress, but it isn't supported in all
browsers.)

-- 
Blah blah bleh...
GCS/CM d(-)@>-- s+:- !a C++$ UBL++++$ L+$ W+++$ w M++ Y++ b++

[toc] | [prev] | [next] | [standalone]


#12802

FromSaikat Saha <saikat.saha5@gmail.com>
Date2014-02-11 20:50 -0800
Message-ID<bc88a386-f68f-4594-b660-bab1e093e7cb@googlegroups.com>
In reply to#12769
On Tuesday, February 11, 2014 9:52:59 AM UTC+5:30, Saikat Saha wrote:
> I am creating an app where I need to upload file using HTML input type="file" to a PHP server,when I upload the file to the PHP link without progress bar its working fine but when i add progress bar count script using ajaxform its unable to upload the file to the PHP server while this progress bar code works fine for this online test server, http://posttestserver.com/post.php.
> 
> 
> 
> I am not getting what is the actual issue as I am not aware of PHP code and my friend is not aware of HTML code,my friend is saying there is nothing to do from his end as it is working fine without progress bar script. I had tried all possible progress bar script available in the web.please help me out how to solve it with progress bar count.

Hi All,when i check the error log in console I found that I am getting some error like ---> disallowed for cross-origin requests that require preflight can help me out what to do now using jquery ajax

[toc] | [prev] | [next] | [standalone]


#12808

FromJerry Stuckle <jstucklex@attglobal.net>
Date2014-02-12 06:35 -0500
Message-ID<ldfmat$6b1$3@dont-email.me>
In reply to#12802
On 2/11/2014 11:50 PM, Saikat Saha wrote:
> On Tuesday, February 11, 2014 9:52:59 AM UTC+5:30, Saikat Saha wrote:
>> I am creating an app where I need to upload file using HTML input type="file" to a PHP server,when I upload the file to the PHP link without progress bar its working fine but when i add progress bar count script using ajaxform its unable to upload the file to the PHP server while this progress bar code works fine for this online test server, http://posttestserver.com/post.php.
>>
>>
>>
>> I am not getting what is the actual issue as I am not aware of PHP code and my friend is not aware of HTML code,my friend is saying there is nothing to do from his end as it is working fine without progress bar script. I had tried all possible progress bar script available in the web.please help me out how to solve it with progress bar count.
>
> Hi All,when i check the error log in console I found that I am getting some error like ---> disallowed for cross-origin requests that require preflight can help me out what to do now using jquery ajax
>

That's an AJAX error message, and has nothing to do with PHP.  You need 
to be following up in a javascript newsgroup.


-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web