Home > Article > CMS Tutorial > What should I do if there is a parameter error when downloading the phpcms v9 attachment?
The solution to the parameter error when downloading phpcms v9 attachments: first find and open the "down.php" file; then delete part of the code of "patch IP" in the file; then upload the overlay and update the cache; finally restart Just click to download.
Phpcms v9 download module parameter error solution
Recommended: "phpcms tutorial 》
Phpcms v9 will check the IP address of the client when downloading, which occasionally leads to parameter errors. I have also queried a lot of information from the Internet. There are only two solutions currently known. After testing One is ineffective and the other cannot solve the fundamental problem. There are two methods already known: one is to add $data['id'] = $id; the test is invalid, the other is to change the download address to display the original download address, and directly generate the download address without processing it through the kernel php file of Phpcms v9. This is true No error will be reported, but it will be a headache for other websites with permission issues.
Let’s talk about the solution developed by code notes, which also benefited from the inspiration from an online article complaining about Phpcms.
1. Open the file /phpcms/modules/content/down.php.
2. Find about 100 lines of the following code:
if(!$downid || empty($fileurl) || !preg_match("/[0-9]{10}/", $starttime) || !preg_match("/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/", $ip) || $ip != ip()) showmessage(L('illegal_parameters'));
3. Delete part of the code of the patch IP in the middle
|| !preg_match("/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/", $ip) || $ip != ip()
The deleted code:
if(!$downid || empty($fileurl) || !preg_match("/[0-9]{10}/", $starttime) ) showmessage(L('illegal_parameters'));
Upload coverage and update cache. Click to download and it works. Leave a note for future reference.
The above is the detailed content of What should I do if there is a parameter error when downloading the phpcms v9 attachment?. For more information, please follow other related articles on the PHP Chinese website!