dongxi5494 2017-08-12 23:33
浏览 25
已采纳

上传大文件不起作用

As the title say I have a problem with uploading video. I need to make a form that upload a file into a folder, it work with photos, and even with videos (or anyway, .mp4 file).

The problem comes when I try to upload big files, because PhP just fail.
I already modified php.ini post max size, max filesize, memory limit and even the time to process script or to input it, but if won't work anyway.

A strange things that I have notice is that when I try to upload big files, looks like php miss name and extension of the file, even if it works perfectly with small files.
How can I fix this? Is there any PhP command to set on the script, or something else in php.ini, looks like the php guide won't help me.Thank's

$extension = pathinfo($_FILES[image]['name'], PATHINFO_EXTENSION);
$target = "uploaded/";
$target = $target . $title.'.'.$extension; 
$pic=($_FILES['image']['name']); 
//Writes the photo to the server 
if(move_uploaded_file($_FILES['image']['tmp_name'], $target)) {
} else {} 
  • 写回答

1条回答 默认 最新

  • douyingbei1458 2017-08-13 20:25
    关注

    As per our discussion in the comments, it appears that you missed restarting the web server after making your php.ini changes. This file is read in at the start of the web server process, not each time a page is accessed. So any changes to this file require a web server restart before they'll take affect.

    To be clear, restarting the web server refers to the web server service, not the OS on the server.

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

报告相同问题?

悬赏问题

  • ¥15 如何解决ldsc的这条报错/index error
  • ¥15 VS2022+WDK驱动开发环境
  • ¥30 关于#java#的问题,请各位专家解答!
  • ¥30 vue+element根据数据循环生成多个table,如何实现最后一列 平均分合并
  • ¥20 pcf8563时钟芯片不启振
  • ¥20 pip2.40更新pip2.43时报错
  • ¥15 换yum源但仍然用不了httpd
  • ¥50 C# 使用DEVMOD设置打印机首选项
  • ¥15 麒麟V10 arm安装gdal
  • ¥20 OPENVPN连接问题