Choose which file types are allowed to be uploaded. ( How to Manage Mime Typles )
This plug-in's Mime filter has the following three-stage structure.
(1) WordPress built-in Mime filter
(2) Mime filter of this plugin (l.63 of allpost-contactform-sub12_uploadAttachment.php and /wp-content/apcf_att/.htaccess)
(3) User's own Mime filter
(1) is followed by (2), and (2) is followed by (3). If the upload is stopped by the filter in (1), it will not proceed to (2), and if it is stopped in (2), it will not proceed to (3).
Therefore, in order to enable the end user's own filter in (3), it is necessary to disable the filters in (1) and (2).
As a developer, we do not recommend changing the filter (stopping .php .py .sh) directly written in l.63 of allpost-contactform-sub12_uploadAttachment.php in (2). This is because most of the servers are rental servers, and PHP, Python, and Shell leave a lot of discretion to the end user (in other words, the server administrator is not necessarily responsible for managing them).
Therefore, we will explain how to change (1) and (3) below. To enable (3), you must first disable (1).
(1) WordPress built-in Mime filter
(2) Mime filter of this plugin (l.63 of allpost-contactform-sub12_uploadAttachment.php and /wp-content/apcf_att/.htaccess)
(3) User's own Mime filter
(1) is followed by (2), and (2) is followed by (3). If the upload is stopped by the filter in (1), it will not proceed to (2), and if it is stopped in (2), it will not proceed to (3).
Therefore, in order to enable the end user's own filter in (3), it is necessary to disable the filters in (1) and (2).
As a developer, we do not recommend changing the filter (stopping .php .py .sh) directly written in l.63 of allpost-contactform-sub12_uploadAttachment.php in (2). This is because most of the servers are rental servers, and PHP, Python, and Shell leave a lot of discretion to the end user (in other words, the server administrator is not necessarily responsible for managing them).
Therefore, we will explain how to change (1) and (3) below. To enable (3), you must first disable (1).
How to remove WordPress’ built-in Mime Filter
[STEP1] Open "allpost-contactform-sub12_uploadAttachment.php".
[STEP2] Please comment l.58 and l.59.
[STEP2] Please comment l.58 and l.59.
Current ( This plugin default )
echo $rl_apcf_public_upload_error_msg;
exit;
After commenting
//echo $rl_apcf_public_upload_error_msg;
//exit;
How to create your own mime-filter ( How to manage "allpost-contactform-upload_mime.php" )
[STEP1] Open "allpost-contactform-upload_mime.php".
[STEP2] Add the extensions you want to allow. How to add:
Please add directly above the part of:
/******* Don't Modify below *******************************/
'txt';
/**********************************************************/
with the format:
[STEP2] Add the extensions you want to allow. How to add:
Please add directly above the part of:
/******* Don't Modify below *******************************/
'txt';
/**********************************************************/
with the format:
extension,
( 2024/10/11, 22:37:37, JST )