jijo-paulose / gwtupload

Automatically exported from code.google.com/p/gwtupload
Other
0 stars 0 forks source link

Add PHP support for jsupload #91

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

This is an enhancement request to allow jsupload to support PHP script on the 
server side.

What is the expected output? What do you see instead?

PHP APC extension facilitate the file upload progress update. The client side 
issue get-progress request to getprogress.php and the later will reply 
accordingly.

The prerequisite for this mechanism to work is the form must include a hidden 
field which will inform the PHP APC engine the unique key to track the 
progress. following is an example:

<form enctype="multipart/form-data" action="xxx.php" method="post"> 
        <input type="hidden" name="APC_UPLOAD_PROGRESS" 
value="GWTMU-3245435322"/> 
        <input type="file" name="GWTMU-3245435322"/> 
        <input type="submit" value="submit"> 
</form> 

attached is the getprogress.php which return the current progress of file 
upload. It's simple and self-describing.

What version of the product are you using? On what operating system?
jsupload 0.6.3. Linux + apache + php

Please provide any additional information below.

To enable the PHP APC extension to support file upload progress indication, 
following section must be put into php.ini:

[APC]                                                                           

apc.enabled=1                                                                   

apc.shm_segments=1                                                              

apc.shm_size=64                                                                 

apc.max_file_size=10M                                                           

apc.stat=1                                                                      

apc.rfc1867="1"                                                                 

apc.rfc1867_freq="0" 

Original issue reported on code.google.com by guangyu....@gmail.com on 8 Feb 2011 at 3:31

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by manuel.carrasco.m on 13 Feb 2011 at 12:32

GoogleCodeExporter commented 9 years ago
Manuel, 

any update on this enhancement?

Original comment by guangyu....@gmail.com on 18 Feb 2011 at 1:04

GoogleCodeExporter commented 9 years ago
Manuel,
Are you on holiday? Could you give me a package including aforementioned 
enhancement?

Thanks.
Guangyu

Original comment by guangyu....@gmail.com on 3 Mar 2011 at 1:40

GoogleCodeExporter commented 9 years ago
Sorry, unfortunately I'm not on holiday. I'm overworked with my job and 
spending my free time in the new release of gwtquery. I promise to do it soon 
(no more than 2 days).

Original comment by manuel.carrasco.m on 3 Mar 2011 at 3:45

GoogleCodeExporter commented 9 years ago
any update?

Original comment by guangyu....@gmail.com on 16 Mar 2011 at 11:48

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r873.

Original comment by manuel.carrasco.m on 22 Mar 2011 at 9:27

GoogleCodeExporter commented 9 years ago
Hello, 

The issue should be fixed, now it is possible to add elements to the panel 
specifying the order.

If you are using jsupload just take a look to the example:
http://code.google.com/p/gwtupload/source/browse/trunk/GwtUpload/jsupload/src/ma
in/java/jsupload/public/JsUpload.html#83

To enable php apc with gwtupload take a look to the example: 
http://code.google.com/p/gwtupload/source/browse/trunk/GwtUpload/samples/src/mai
n/java/gwtuploadsample/client/SingleUploadSample.java#67

I have added your php code, modified to produce xml responses to the sources. I 
have not tested it, if you test it or improve it send a comment to this issue.

Thanks for contributing, and I apologize for the long delay fixing the issue.

- Manolo

Original comment by man...@talkwheel.com on 22 Mar 2011 at 10:20

GoogleCodeExporter commented 9 years ago
Hi Manolo,

Thanks a lot for making the enhancement happen under high job load. I tested 
the 0.6.4 snapshot jsupload. Basically, PHP APC file upload progress mechanism 
works after this enhancement. But I encountered some problem on the progress 
bar on browser side:

1)for files of small size (say less than 200K), Chrome(10.0.648.127) and 
Firefox(3.6.16) will freeze on progress 0%, although the file is actually 
uploaded to server side. I checked the access log of Apache, In the condition, 
there was no GET filename request after POST request. But IE 7 is OK for this 
case.

2)for files of large size (> 15M), for Chrome and Firefox, the progress bar 
always stuck at the point right before the server returns 100%. In comparison, 
IE7 succeed to reach 100% and Done status in most cases but stuck occasionally. 
I checked the access log, the browser continuously issue the GET progress 
request after the file is completely uploaded. To confirm the server's respond 
message, I revised the perl and PHP cgi script to write the response message to 
a log file and confirm the server respond with 100% progress accordingly. It 
seems the client side totally ignore the message. 

I also confirm above two problems is also with the jsupload.cgi.pl. It seems 
some regression bug is introduced in this snapshot release. 

Could you please have a look?

Thanks,
Guangyu 

Original comment by guangyu....@gmail.com on 25 Mar 2011 at 8:40

Attachments:

GoogleCodeExporter commented 9 years ago
Hello, I have modified your php script so as it works fine with 0.6.4-SNAPSHOT.
Download it from:
http://gwtupload.googlecode.com/svn-history/r880/trunk/GwtUpload/jsupload/src/ma
in/java/jsupload/public/jsupload.php
And use latest snapshot.

I have tested it and seems to work quite well, please check that it works for 
you and review the code to make suggestions.

btw: Also I have fixed the perl script version to work with latest release.

Thank you very much for your contribution

- Manolo

Original comment by manuel.carrasco.m on 11 Apr 2011 at 10:55

GoogleCodeExporter commented 9 years ago
Hi Manolo,

I tested the new script and I'm very happy to see it works very well. Thank you 
for your great job.

Two minor issue regarding jsupload.php:

1. session_start() at line#79 should be moved before line#63 where session_id() 
is called, since session_id() can return current session id only after the 
invocation of session_start().

2. delete .info file when remove action is requested

Best regards,
Guangyu

Original comment by guangyu....@gmail.com on 16 Apr 2011 at 11:22

Attachments:

GoogleCodeExporter commented 9 years ago
Committed in r888

Thank you very much.

- Manolo

Original comment by manuel.carrasco.m on 18 Apr 2011 at 6:42