Re: [PHP] Uploading large files with HTTP_Request class

2012-05-31 Thread Jim Lucas

On 05/31/2012 03:28 AM, Voß, Marko wrote:

Hello,

I need to perform uploading of large files using the HTTP_Request class:

http://pear.php.net/manual/package.http.http-request.php

How am I supposed to do that with this class? Are there any alternatives, which 
do not force me to add new PHP dependancies/libraries to the project? I am 
writing a library and do not want to force the users to add dependancies to 
their projects in order to use this library.


You don't want to require additional dependencies yet you require PEAR.

Isn't PEAR an addition dependency?



I am currently using PHP 5.3.0.


Thank you and best regards,
Marko



--
Jim Lucas

http://www.cmsws.com/
http://www.cmsws.com/examples/
http://www.bendsource.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Uploading large files with HTTP_Request class

2012-05-31 Thread Bastien Koert
On Thu, May 31, 2012 at 12:24 PM, Jim Lucas li...@cmsws.com wrote:
 On 05/31/2012 03:28 AM, Voß, Marko wrote:

 Hello,

 I need to perform uploading of large files using the HTTP_Request class:

 http://pear.php.net/manual/package.http.http-request.php

 How am I supposed to do that with this class? Are there any alternatives,
 which do not force me to add new PHP dependancies/libraries to the project?
 I am writing a library and do not want to force the users to add
 dependancies to their projects in order to use this library.


 You don't want to require additional dependencies yet you require PEAR.

 Isn't PEAR an addition dependency?



 I am currently using PHP 5.3.0.


 Thank you and best regards,
 Marko



 --
 Jim Lucas

 http://www.cmsws.com/
 http://www.cmsws.com/examples/
 http://www.bendsource.com/


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


If you don't want dependencies, try swfuploader...uses flash but is
more robust for large file uploads,


-- 

Bastien

Cat, the other other white meat

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Uploading large files with HTTP_Request class

2012-05-31 Thread Jim Lucas

On 05/31/2012 11:34 AM, Bastien Koert wrote:

On Thu, May 31, 2012 at 12:24 PM, Jim Lucasli...@cmsws.com  wrote:

On 05/31/2012 03:28 AM, Voß, Marko wrote:


Hello,

I need to perform uploading of large files using the HTTP_Request class:

http://pear.php.net/manual/package.http.http-request.php

How am I supposed to do that with this class? Are there any alternatives,
which do not force me to add new PHP dependancies/libraries to the project?
I am writing a library and do not want to force the users to add
dependancies to their projects in order to use this library.



You don't want to require additional dependencies yet you require PEAR.

Isn't PEAR an addition dependency?




I am currently using PHP 5.3.0.


Thank you and best regards,
Marko




--
Jim Lucas

http://www.cmsws.com/
http://www.cmsws.com/examples/
http://www.bendsource.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



If you don't want dependencies, try swfuploader...uses flash but is
more robust for large file uploads,




From what I read, he is wanting the server to upload a file to a remote 
machine.  Not a client uploading to his server.


--
Jim Lucas

http://www.cmsws.com/
http://www.cmsws.com/examples/
http://www.bendsource.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Uploading large files with HTTP_Request class

2012-05-31 Thread tamouse mailing lists
On Thu, May 31, 2012 at 5:28 AM, Voß, Marko marko.v...@fiz-karlsruhe.de wrote:
 Hello,

 I need to perform uploading of large files using the HTTP_Request class:

 http://pear.php.net/manual/package.http.http-request.php

 I am *not* using this one:

 http://php.net/manual/en/class.httprequest.php


 The HTTP_Request class support the following functions:

 setBody() and addFile()

 The addFile()-function however simulates a form field and the server 
 application does not read the incoming file from such a field. I have to put 
 the file content as a stream through the body.

 Adding the file content using the setBody()-function will of course cause an 
 out of memory error:

 $fp = fopen($filename, 'r');
 $request-setBody(fread($fp, $filesize($filename)));
 $fclose($fp);
 $response = $request-sendRequest();


 How am I supposed to do that with this class? Are there any alternatives, 
 which do not force me to add new PHP dependancies/libraries to the project? I 
 am writing a library and do not want to force the users to add dependancies 
 to their projects in order to use this library.

 I am currently using PHP 5.3.0.


 Thank you and best regards,
 Marko


 ---

 Fachinformationszentrum Karlsruhe, Gesellschaft für 
 wissenschaftlich-technische Information mbH.
 Sitz der Gesellschaft: Eggenstein-Leopoldshafen, Amtsgericht Mannheim HRB 
 101892.
 Geschäftsführerin: Sabine Brünger-Weilandt.
 Vorsitzender des Aufsichtsrats: MinDirig Dr. Thomas Greiner.



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


Does the receiving server only accept uploads via HTTP? Or is there
another protocol you could use? I'm not aware of anyway via HTTP you
can send chunks up; as far as I know, that only works for
server-client transfers.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Uploading large files with HTTP_Request class

2012-05-31 Thread tamouse mailing lists
On Thu, May 31, 2012 at 5:28 AM, Voß, Marko marko.v...@fiz-karlsruhe.de wrote:
 I need to perform uploading of large files using the HTTP_Request class:
 http://pear.php.net/manual/package.http.http-request.php
 The HTTP_Request class support the following functions:
 setBody() and addFile()

Reading the above, and checking on the documentation, I notice an inconsistency.

I only find the setBody() method in HTTP_Request2, while addFile() is
in HTTP_Request. The correct method for adding files in HTTP_Request2
is addUpload() (which still may not work given the limitations of the
upstream server).

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Uploading large files with HTTP_Request class

2012-05-31 Thread Matijn Woudt
On Thu, May 31, 2012 at 12:28 PM, Voß, Marko
marko.v...@fiz-karlsruhe.de wrote:
 Hello,

 I need to perform uploading of large files using the HTTP_Request class:

 http://pear.php.net/manual/package.http.http-request.php

 I am *not* using this one:

 http://php.net/manual/en/class.httprequest.php


 The HTTP_Request class support the following functions:

 setBody() and addFile()

 The addFile()-function however simulates a form field and the server 
 application does not read the incoming file from such a field. I have to put 
 the file content as a stream through the body.

 Adding the file content using the setBody()-function will of course cause an 
 out of memory error:

 $fp = fopen($filename, 'r');
 $request-setBody(fread($fp, $filesize($filename)));
 $fclose($fp);
 $response = $request-sendRequest();


 How am I supposed to do that with this class? Are there any alternatives, 
 which do not force me to add new PHP dependancies/libraries to the project? I 
 am writing a library and do not want to force the users to add dependancies 
 to their projects in order to use this library.

 I am currently using PHP 5.3.0.


 Thank you and best regards,
 Marko



If you don't want any additional libraries, I would suggest writing
such a request yourself with the use of simple sockets.

- Matijn

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php