Stut, thank you very much for explaining things and trying to help.

The applet *does* POST to PHP. However, it has the option to upload to an FTP server.... "the choice of using HTTP, HTTPS or FTP connections for your transfer" (from the website).

So it seems applet posts complete data to that php file handling script (rather php engine),*as soon as upload button is clicked*, rather than uploading first and then posting to php. That is the reason for name phpxx.tmp of temporary file.

As that seems to be the case; there is no real benefit in using applet (in case of http) other than that progress bar which is already supported by php 5.2

It also seems that php engine only hands over control to php file after the file is completely uploaded that is why my custom logging doesn't start as soon as upload starts. It only starts when file is already uploaded.

The timeout is likely coming from Apache. It has a limits similar to PHP.

Tested on two servers. Both cases it seems to fail if it takes more than 30 seconds.
I get an error:
[08-Jun-2007 20:15:06] PHP Fatal error: Maximum execution time of 30 seconds exceeded in ....\handle_upload.php on line 2


If you don't mind me asking, what are people uploading? 4gig is a lot for a single file of any type except maybe DVD images. Is there no way the user can upload several (read lots) smaller files instead of one big one?

It is not people that are uploading things. It is admin, and admin is local to server. I won't want to try uploading 4 GB over internet. And yes these are dvd files. They are going to be uploaded for streaming. But along with uploading of files som other fields also have to be uploaded. Client is showing examples like http://www.attachmore.com/Whysubscribe.aspx which claim unlimited upload size. I assume they are using custom activex controls.

Looks like I have to post that php's upload limit of 1.99 gb to php internal mailing list.

Thanks again,
Sukhwinder Singh




. ----- Original Message ----- From: "Stut" <[EMAIL PROTECTED]>
To: "Sukhwinder Singh" <[EMAIL PROTECTED]>
Cc: "Jim Moseby" <[EMAIL PROTECTED]>; <php-general@lists.php.net>
Sent: Friday, June 08, 2007 6:42 PM
Subject: Re: [PHP] Re: File Upload - post_max_size and upload_max_filesize in GBs


Sukhwinder Singh wrote:
PHP's handling of uploaded files is confusing. I have added logging to the script to which jupload posts. Logging suggests that php file is only accessed after file is completely uploaded by jupload. I also checked apache access logs. Entry in apache log appears only after file is completely uploaded.

Absolutely correct - the data sent with an HTTP POST will be completely uploaded before the PHP script is started. Likewise, the entry in the apache log will only be done once the request is completed otherwise it doesn't know all the information it needs.

Another thing that came up with this jupload is that as soon as I hit upload button, a file named phpxx.tmp (xx is any number) is created in temporary directory and its size starts growing as upload happens.

If applet doesn't post to php even at start then how come the temporary file is named phpxx.tmp.

The applet *does* POST to PHP. However, it has the option to upload to an FTP server.... "the choice of using HTTP, HTTPS or FTP connections for your transfer" (from the website).

I tried to upload file on internet using jupload and it seems to me script is timing out even when I have specified 1 hour as timeout.
set_time_limit(216000);

137 MB upload seemed to time out. and the set_time_limit doesn't seem to have any affect.

Now the even if I accept php's 1.99 GB limit. What to do about this timeout? Do I have to set it in php.ini? Why woudn't it work through the above function?

The timeout is likely coming from Apache. It has a limits similar to PHP.

Stut is suggesting it has to be custom made as this kind of solution doesn't seem to already exit. A solution where some applet etc. only passes that information to php which is needed to move the file and update the database.

Indeed, that is what I'm suggesting. However, I *do* think the solution exists, but I've only ever seen it on specific websites. I've never seen a product that can do this sort of thing.

If you don't mind me asking, what are people uploading? 4gig is a lot for a single file of any type except maybe DVD images. Is there no way the user can upload several (read lots) smaller files instead of one big one?

-Stut


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

Reply via email to