upload_func = 'copy';" to "$this->upload_func='move_upload"."/> upload_func = 'copy';" to "$this->upload_func='move_upload".">
search
HomeCMS TutorialPHPCMSWhat to do if phpcms attachment fails to upload

What to do if phpcms attachment fails to upload

What should I do if the phpcms attachment fails to upload?

The first solution: directly modify the apache configuration file. Modify the php.ini file (this method is only applicable to VPS, independent servers, or locally built environments, not applicable to virtual hosts, this is for reference only).

Change; extension=php_zip.dll to: extension=php_zip.dll. (That is, remove the ";" in the previous code)

The second solution: modify the attachment.class.php file.

Change $this->upload_func = 'copy';

to $this->upload_func = 'move_uploaded_file';

Warm reminder: This method may cause the image to be unable to be automatically saved remotely.

The third solution: modify the code file. Find the phpcms\modules\attachment\attachments.php file.

Replace the following code:

If(empty($this->userid)){

with:

if(empty($_POST[‘userid’])){

Save the upload and overwrite it before it can be solved. This method is submitted with administrator rights.

The fourth solution: comment code method. Find the phpcms\modules\attachment\attachments.php file.

Comment out all lines of code around 50-54. The specific commented out code is as follows:

//判断是否登录
If(empty($this->userid)){
exit(‘0’);
}

Delete or comment out these lines of code for now. Here it is determined that uploading can only be done after logging in. Otherwise, the return is a 0 exit, which means undefined.

The above 4 types are the four perfect solutions compiled by the editor to solve the undefined prompt when uploading pictures or attachments in phpcms.

PHP Chinese website, a large number of free PHPCMS tutorials, welcome to learn online!

The above is the detailed content of What to do if phpcms attachment fails to upload. For more information, please follow other related articles on the PHP Chinese website!

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor