What should I do if the file cannot be found when downloading php?

藏色散人
Release: 2023-03-07 09:50:01
Original
2480 people have browsed it

The solution to the problem that the file cannot be found when downloading php: first open the corresponding code file; then modify the content to "ini_set('memory_limit','350M');"; finally add the "ob_end_clean()" function and Just save the changes.

What should I do if the file cannot be found when downloading php?

Recommended: "PHP Video Tutorial"

Solution to the problem that the PHP download file is too large and the file cannot be found The method

set_time_limit(0);
ini_set('memory_limit','350M');
header("Cache-Control: public");
header("Content-Description: File Transfer");
header('Content-disposition: attachment; filename=' . basename($file_name . $extension)); //文件名
header("Content-Transfer-Encoding: binary"); //告诉浏览器,这是二进制文件
header('Content-Length: ' . filesize($filename)); //告诉浏览器,文件大小
ob_end_clean();
readfile($file);
Copy after login

is mainly the setting of memory_limit() and the use of ob_end_clean() function

The above is the detailed content of What should I do if the file cannot be found when downloading php?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template