开发者

uploading large file in php

开发者 https://www.devze.com 2023-03-13 02:48 出处:网络
I need to make a module for uploading files with type *.flv in PHP. I have been successful in uploading small files but am unable to upload large files.

I need to make a module for uploading files with type *.flv in PHP.

I have been successful in uploading small files but am unable to upload large files.

I have updated PHP values like

php_value memory_limit 120M
php_value max_execution_time 120
php_value upload_max_filesize 10G
php_value post_max_size 10G
php_value max_input_time 500

I am doing a file upload using PHP, which works fine for a file of size 2.8MB on my localhost - but not my Mediatemple GS host. Files smaller than 2MB work fine, but anything larger seems to not work. I am not getting any error message but when the upload finishes, the file is not found in the uploads directory.

I searched around, and added the f开发者_StackOverflowollowing lines to the .htaccess file:

php_value memory_limit 120M
php_value max_execution_time 120
php_value upload_max_filesize 10G
php_value post_max_size 10G
php_value max_input_time 500

but it is still not working. Please help.


Maybe your max_execution_time is more 2 minutes !
check how time your script run.
Usually for upload big file developper use FTP or host sharing. (megaupload/rapidshare/...)


i guess all you need is

ini_set("memory_limit","2048M");    # 2 GB
set_time_limit(0);          # unlimited exec time

i read somewhere in PHPdocs that it only allows upto 2GB file transfer

0

精彩评论

暂无评论...
验证码 换一张
取 消