Upload large files to FTP with PHP

前端 未结 2 1606
孤独总比滥情好
孤独总比滥情好 2021-01-22 05:53

I\'m trying to upload large files with php to an ftp server. I can upload small files, but I\'m having trouble uploading larger files. I have looked it up and found that I nee

相关标签:
2条回答
  • 2021-01-22 06:34

    From this site: http://www.php.net/manual/en/ini.php

    'upload_max_filesize' and 'post_max_size'

    are of type PHP_INI_PERDIR

    which means Entry can be set in "php.ini, .htaccess or httpd.conf". So you can't set it in your script.

    --- Edit ---

    A similar question: Changing upload_max_filesize on PHP

    --- Edit 2 ---

    Personally, I wanted to do the same kind of stuff (upload large files over ftp) and end up writing a java application. For handling large files, php is not really the best way. Web browsers doesn't really like that. So, for handling large files, I would suggest to look at other alternative: (java, swf, javascript, ...)

    Something I would like to give a try when I have some time is http://nodejs.org/

    0 讨论(0)
  • 2021-01-22 06:51

    as rightly pointed out by @AngeDeLaMort, you cannot use shorthand notation to set configuration values outside of PHP.ini.

    reference : Changing upload_max_filesize on PHP

    try doing it this way.

    create .htaccess file in your root directory and add the following.

    php_value upload_max_filesize 50M
    php_value post_max_size 50M
    php_value max_execution_time 200
    php_value max_input_time 200
    
    0 讨论(0)
提交回复
热议问题