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 安装svn网络有问题怎么办
  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥15 latex怎么处理论文引理引用参考文献