[PHP] how to upload large file ( bigger than 1G) with PHP
hello, guys, I have tried many ways and was told to use C or Perl. Perl is a stranger to me and I never use C in a project. Is there anybody would tell me how to make php interact with C/Perl and how to maintain sessions during the interacting time ? thanks in advance!
Re: [PHP] how to upload large file ( bigger than 1G) with PHP
Hi, You can always change php.ini settings to allow larger file uploads. *upload_max_filesize = 2M* Increase it to fit your need. You may need to change this as well: *post_max_size = 10M * Let me know if it works for you. :) -- Regards, Vikash Kumar -- http://vika.sh On Fri, Mar 12, 2010 at 1:39 PM, 杜越 o...@gmail.com wrote: hello, guys, I have tried many ways and was told to use C or Perl. Perl is a stranger to me and I never use C in a project. Is there anybody would tell me how to make php interact with C/Perl and how to maintain sessions during the interacting time ? thanks in advance!
Re: [PHP] how to upload large file ( bigger than 1G) with PHP
try http://jumploader.com/ it's java+php, and free. On Fri, Mar 12, 2010 at 9:09 AM, 杜越 o...@gmail.com wrote: hello, guys, I have tried many ways and was told to use C or Perl. Perl is a stranger to me and I never use C in a project. Is there anybody would tell me how to make php interact with C/Perl and how to maintain sessions during the interacting time ? thanks in advance! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to upload large file ( bigger than 1G) with PHP
Always prefer FTP for large file uploads. On Fri, Mar 12, 2010 at 3:38 PM, Rene Veerman rene7...@gmail.com wrote: try http://jumploader.com/ it's java+php, and free. On Fri, Mar 12, 2010 at 9:09 AM, 杜越 o...@gmail.com wrote: hello, guys, I have tried many ways and was told to use C or Perl. Perl is a stranger to me and I never use C in a project. Is there anybody would tell me how to make php interact with C/Perl and how to maintain sessions during the interacting time ? thanks in advance! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Devendra Jadhav देवेंद्र जाधव
Re: [PHP] how to upload large file ( bigger than 1G) with PHP
On Fri, 2010-03-12 at 18:11 +0530, Devendra Jadhav wrote: Always prefer FTP for large file uploads. On Fri, Mar 12, 2010 at 3:38 PM, Rene Veerman rene7...@gmail.com wrote: try http://jumploader.com/ it's java+php, and free. On Fri, Mar 12, 2010 at 9:09 AM, 杜越 o...@gmail.com wrote: hello, guys, I have tried many ways and was told to use C or Perl. Perl is a stranger to me and I never use C in a project. Is there anybody would tell me how to make php interact with C/Perl and how to maintain sessions during the interacting time ? thanks in advance! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I've noticed that large uploads over http seem to behave a little unpredictably at times, and aren't something I'd rely on. FTP is definitely the way to go, and there are plenty of Java applets that allow you to do this. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] how to upload large file ( bigger than 1G) with PHP
On Fri, Mar 12, 2010 at 4:41 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: I've noticed that large uploads over http seem to behave a little unpredictably at times, and aren't something I'd rely on. FTP is definitely the way to go, and there are plenty of Java applets that allow you to do this. FTP is not a realistic option, for a multitude of reasons. a) mapping an HTTP request and user - FTP account / pick this file up b) firewall issues c) additional services having to be enabled and routed to on the server side While I do agree FTP is FILE transfer protocol, it still isn't the right solution IMHO. Ideally, HTML5 will provide a more industry standard method (IIRC, a coworker already pointed out something in the spec for it, but I forget) A very workable solution we've came up with has been using Google Gears + PHP. Re-using the browser and HTTP conversations provides us multiple benefits: a) Cookie support - to identify the user b) supports HTTP and HTTPS c) Firewalls are not an issue - reuses the same proxy settings The difference between standard file upload using a single POST vs. our method is key - it's chunking the file. Google Gears has this support, Java can too; send up portions of the file at a time, and either glue it together on the fly on the server, or take all the chunks and merge them all at once at the end. By doing it in a chunked format, it allows us to also re-transmit failed chunks and treat files of any size in bite size chunks - with a little bit of Javascript, PHP and Gears, we can support files of any size (within filesystem and OS limits) and it does not require -any- tweaking of the webserver. It is chunks of data sent to the server using standard POSTs and small enough to fit under even small PHP and webserver memory limits (and could always be configurable) - no more suhosin.memory_limit, memory_limit, post_max_size, upload_max_filesize to fuss with. It's a shame that Google had to decide to stop developing and maintaining Gears. It was a lightweight, perfect solution. We're working on a Java-based version instead now. Lightest footprint we can possibly get in Java, but it's the only applet language that has all the support we need for chunking, cross-browser, cross-platform, etc. I believe our plan is to release it out to the public so people can enhance it, use it, do whatever... For now though, Gears works pretty awesome for us, a handful of our users have complained though Gears won't install for them (not sure why) and there is no support for Snow Leopard, I believe. So we're starting to hit the point where it isn't our magical solution anymore. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to upload large file ( bigger than 1G) with PHP
On Fri, 2010-03-12 at 11:37 -0800, Michael Shadle wrote: On Fri, Mar 12, 2010 at 4:41 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: I've noticed that large uploads over http seem to behave a little unpredictably at times, and aren't something I'd rely on. FTP is definitely the way to go, and there are plenty of Java applets that allow you to do this. FTP is not a realistic option, for a multitude of reasons. a) mapping an HTTP request and user - FTP account / pick this file up b) firewall issues c) additional services having to be enabled and routed to on the server side While I do agree FTP is FILE transfer protocol, it still isn't the right solution IMHO. Ideally, HTML5 will provide a more industry standard method (IIRC, a coworker already pointed out something in the spec for it, but I forget) A very workable solution we've came up with has been using Google Gears + PHP. Re-using the browser and HTTP conversations provides us multiple benefits: a) Cookie support - to identify the user b) supports HTTP and HTTPS c) Firewalls are not an issue - reuses the same proxy settings The difference between standard file upload using a single POST vs. our method is key - it's chunking the file. Google Gears has this support, Java can too; send up portions of the file at a time, and either glue it together on the fly on the server, or take all the chunks and merge them all at once at the end. By doing it in a chunked format, it allows us to also re-transmit failed chunks and treat files of any size in bite size chunks - with a little bit of Javascript, PHP and Gears, we can support files of any size (within filesystem and OS limits) and it does not require -any- tweaking of the webserver. It is chunks of data sent to the server using standard POSTs and small enough to fit under even small PHP and webserver memory limits (and could always be configurable) - no more suhosin.memory_limit, memory_limit, post_max_size, upload_max_filesize to fuss with. It's a shame that Google had to decide to stop developing and maintaining Gears. It was a lightweight, perfect solution. We're working on a Java-based version instead now. Lightest footprint we can possibly get in Java, but it's the only applet language that has all the support we need for chunking, cross-browser, cross-platform, etc. I believe our plan is to release it out to the public so people can enhance it, use it, do whatever... For now though, Gears works pretty awesome for us, a handful of our users have complained though Gears won't install for them (not sure why) and there is no support for Snow Leopard, I believe. So we're starting to hit the point where it isn't our magical solution anymore. It's not much trouble to map the FTP to a file and have the right permissions, and FTP is a doddle to set up on a server. I'd say a darn sight less work than rolling your own mechanism in Java. Lastly, I don't think firewalls are that big an issue, as most firewalls I've seen will allow outgoing FTP connections from a users computer by default. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] how to upload large file ( bigger than 1G) with PHP
On Fri, Mar 12, 2010 at 11:51 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: It's not much trouble to map the FTP to a file and have the right permissions, and FTP is a doddle to set up on a server. I'd say a darn sight less work than rolling your own mechanism in Java. Well, mechanisms already exist. We're just trying to create a cleaner one that works with the browser's DOM so it looks native in the browser, has the chunk support, etc. FTP servers can be easy to setup but mapping who uploaded what and keeping that secure is a pain. Do you use one generic account, or one random account per user? If one generic account, how do you keep others from downloading someone else's content? etc? Lots of questions come to mind. But lunch is more important... :) Lastly, I don't think firewalls are that big an issue, as most firewalls I've seen will allow outgoing FTP connections from a users computer by default. Must not deal with that many corporate firewalls :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to upload a file
post_max_size 8M upload_tmp_dir didn't set to any value It fails immediately after clicking the submit button. [thanx for ur concern] On Wed, 18 Dec 2002, Rich Gray wrote: What are these settings in your php.ini? post_max_size upload_tmp_dir Does the upload_tmp_dir have enough space? Are the permissions on the directory correct? When you start the upload - how long does it take to fail immeditaely you click submit or after a delay. If the latter then is there anything created in the upload directory after teh submit is clicked and before it fails...? -Original Message- From: Somesh [mailto:[EMAIL PROTECTED]] Sent: 18 December 2002 15:52 To: Rich Gray Cc: [EMAIL PROTECTED] Subject: RE: [PHP] How to upload a file No difference On Wed, 18 Dec 2002, Rich Gray wrote: As others have suggested does it make any difference if you up the script timeout limit with set_time_limit() or via the max_execution_time in php.ini? -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to upload a file
And if you select a small file it works fine right? -Original Message- From: Somesh [mailto:[EMAIL PROTECTED]] Sent: 20 December 2002 12:29 To: Rich Gray Cc: [EMAIL PROTECTED] Subject: RE: [PHP] How to upload a file post_max_size 8M upload_tmp_dir didn't set to any value It fails immediately after clicking the submit button. [thanx for ur concern] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to upload a file
Hi, I am using the following code to upload file; X--- form enctype=multipart/form-data action=load.php method=post input type=hidden name=MAX_FILE_SIZE value=10 Send the file: input type=file name=userfilebr input type=submit value=Send /form X--- This works fine for small files of like some Kbs but fails to upload larger files near to 1MB. Can any one help me out from this problem my file processing code is:: X--- if(is_uploaded_file($userfile)) { copy($userfile,./upload/$userfile_name); echo Successfully completed the uploading of the file $userfile_name of size $userfile_sizebr; }else{ echo some error has occured while uploading the file $userfile_namebr; echo $userfile; } -X--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to upload a file
Hi Somesh, This works fine for small files of like some Kbs but fails to upload larger files near to 1MB. What's your upload_max_size set to in php.ini? Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to upload a file
Look for the limit in php.ini http://www.php.net/manual/en/configuration.directives.php#ini.upload-max-filesize Gr, Wico At 16:47 18-12-02 +0530, Somesh wrote: Hi, I am using the following code to upload file; X--- form enctype=multipart/form-data action=load.php method=post input type=hidden name=MAX_FILE_SIZE value=10 Send the file: input type=file name=userfilebr input type=submit value=Send /form X--- This works fine for small files of like some Kbs but fails to upload larger files near to 1MB. Can any one help me out from this problem my file processing code is:: X--- if(is_uploaded_file($userfile)) { copy($userfile,./upload/$userfile_name); echo Successfully completed the uploading of the file $userfile_name of size $userfile_sizebr; }else{ echo some error has occured while uploading the file $userfile_namebr; echo $userfile; } -X--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to upload a file
Hi Jon, It is as follows ; Maximum allowed size for uploaded files. upload_max_filesize = 8M On Wed, 18 Dec 2002, Jon Haworth wrote: Hi Somesh, This works fine for small files of like some Kbs but fails to upload larger files near to 1MB. What's your upload_max_size set to in php.ini? Cheers Jon -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to upload a file
Are you sure it's PHP the one that fails? i.e. do you get the some error has occured while uploading the file $userfile_namebr message or some other message? I had this kind of problem when trying to store incoming files in a database, and the link to the database failed, not PHP. Also, if you have a slow connection, PHP might time out? I'm not sure if this is possible though, because I expect Apache to handle the upload (well, technically the download) and only run your PHP script after it finished that, but who knows? Bogdan Somesh wrote: Hi Jon, It is as follows ; Maximum allowed size for uploaded files. upload_max_filesize = 8M On Wed, 18 Dec 2002, Jon Haworth wrote: Hi Somesh, This works fine for small files of like some Kbs but fails to upload larger files near to 1MB. What's your upload_max_size set to in php.ini? Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to upload a file
Hi Somesh, This works fine for small files of like some Kbs but fails to upload larger files near to 1MB. What's your upload_max_size set to in php.ini? It is as follows ; Maximum allowed size for uploaded files. upload_max_filesize = 8M I don't have a clue then, sorry :-( Might be a timeout thing, but I can't see how that could affect it... you could try bumping up max_execution_time and see if anything happens grin Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to upload a file
What does print_r($_FILES) tell you? Is $_FILES['userfile']['error'] set to a value? Rich -Original Message- From: Somesh [mailto:[EMAIL PROTECTED]] Sent: 18 December 2002 11:18 To: [EMAIL PROTECTED] Subject: [PHP] How to upload a file Hi, I am using the following code to upload file; X--- form enctype=multipart/form-data action=load.php method=post input type=hidden name=MAX_FILE_SIZE value=10 Send the file: input type=file name=userfilebr input type=submit value=Send /form X--- This works fine for small files of like some Kbs but fails to upload larger files near to 1MB. Can any one help me out from this problem my file processing code is:: X--- if(is_uploaded_file($userfile)) { copy($userfile,./upload/$userfile_name); echo Successfully completed the uploading of the file $userfile_name of size $userfile_sizebr; }else{ echo some error has occured while uploading the file $userfile_namebr; echo $userfile; } -X--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to upload a file
It is not displaying any thing. It just gives the browser's error page The page cannot be displayed And the print_r($_FILES) prints an empty array; On Wed, 18 Dec 2002, Rich Gray wrote: What does print_r($_FILES) tell you? Is $_FILES['userfile']['error'] set to a value? Rich -Original Message- From: Somesh [mailto:[EMAIL PROTECTED]] Sent: 18 December 2002 11:18 To: [EMAIL PROTECTED] Subject: [PHP] How to upload a file Hi, I am using the following code to upload file; X--- form enctype=multipart/form-data action=load.php method=post input type=hidden name=MAX_FILE_SIZE value=10 Send the file: input type=file name=userfilebr input type=submit value=Send /form X--- This works fine for small files of like some Kbs but fails to upload larger files near to 1MB. Can any one help me out from this problem my file processing code is:: X--- if(is_uploaded_file($userfile)) { copy($userfile,./upload/$userfile_name); echo Successfully completed the uploading of the file $userfile_name of size $userfile_sizebr; }else{ echo some error has occured while uploading the file $userfile_namebr; echo $userfile; } -X--- -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to upload a file
As others have suggested does it make any difference if you up the script timeout limit with set_time_limit() or via the max_execution_time in php.ini? -Original Message- From: Somesh [mailto:[EMAIL PROTECTED]] Sent: 18 December 2002 13:37 To: Rich Gray Cc: [EMAIL PROTECTED] Subject: RE: [PHP] How to upload a file It is not displaying any thing. It just gives the browser's error page The page cannot be displayed And the print_r($_FILES) prints an empty array; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to upload a file
No difference On Wed, 18 Dec 2002, Rich Gray wrote: As others have suggested does it make any difference if you up the script timeout limit with set_time_limit() or via the max_execution_time in php.ini? -Original Message- From: Somesh [mailto:[EMAIL PROTECTED]] Sent: 18 December 2002 13:37 To: Rich Gray Cc: [EMAIL PROTECTED] Subject: RE: [PHP] How to upload a file It is not displaying any thing. It just gives the browser's error page The page cannot be displayed And the print_r($_FILES) prints an empty array; -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to upload a file
What are these settings in your php.ini? post_max_size upload_tmp_dir Does the upload_tmp_dir have enough space? Are the permissions on the directory correct? When you start the upload - how long does it take to fail immeditaely you click submit or after a delay. If the latter then is there anything created in the upload directory after teh submit is clicked and before it fails...? -Original Message- From: Somesh [mailto:[EMAIL PROTECTED]] Sent: 18 December 2002 15:52 To: Rich Gray Cc: [EMAIL PROTECTED] Subject: RE: [PHP] How to upload a file No difference On Wed, 18 Dec 2002, Rich Gray wrote: As others have suggested does it make any difference if you up the script timeout limit with set_time_limit() or via the max_execution_time in php.ini? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php