douwei1930 2014-08-20 12:30
浏览 26
已采纳

如何使用PHP上传超过50 mp .mp3文件?

I am new to php and i want solution for large mp3 upload into php server.

I am using this way to upload mp3 file but getting issue when i upload large file. Code:

$mp3=$_FILES['upload_file']['name'] ;
    $folder="../songs";\
move_uploaded_file($_FILES["upload_file"]["tmp_name"],$folder."/".$mp3);
    $path = $folder."/".$mp3;   

Please give me guideline or snippet to upload mp3 file.

  • 写回答

1条回答 默认 最新

  • duanlang1531 2014-08-20 12:34
    关注

    Change values in your php.ini

    ; Maximum allowed size for uploaded files.
    upload_max_filesize = 50M
    
    ; Must be greater than or equal to upload_max_filesize
    post_max_size = 50M
    

    Note: You need to restart your HTTP server to use new configuration.

    You can also do this with .htaccess file

    php_value upload_max_filesize 40M
    php_value post_max_size 42M
    

    You can also use ini_set() function:

    ini_set('post_max_size', '64M');
    ini_set('upload_max_filesize', '64M');
    

    More details

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?