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

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

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作