CF7 v5.x issue with removing uploaded files on IIS
-
Furthering discussion on https://www.ads-software.com/support/topic/unlink-permission-denied-error/
WordPress Version: 4.9.8
Contact Form 7 Version: 5.0.4
IIS 7.5 WebserverThis issue seems to be new as of CF7 v5.x Form worked flawlessly on v4.x
Here is what I know so far.
1) Issue only seem to rear its head when using the CF7 upload field. If submission is made, and the upload field is used, the spinning sending icon will remain forever and not display the confirmation message or thank you page redirect. If the upload field is not used, form sends fine and thank you message/page is displayed.
2) Forms results WILL be sent to both the admin and user (if set) and the attachment is sent fine.
3) Issue seems to occur when CF7 is trying to remove the uploaded file from the temp directory following a successful mail send. When checking the debug log, the following is present:
[24-Sep-2018 15:11:21 UTC] PHP Warning: unlink(D:\path\to\website\domain\wwwroot/wp-content/uploads/wpcf7_uploads/1217782846/file.docx): Permission denied in D:\path\to\website\domain\wwwroot\wp-content\plugins\contact-form-7\includes\functions.php on line 256
4) Issue may be related only to IIS installations only vs. Apache installations (yet to be confirmed). On our server, permissions are set just fine. WordPress/plugins/themes can update themselves just fine. New plugins installed fine. Plugin seems to have issue with it’s own temp uploads folder.
5) Problem didn’t exist prior to CF7 v5.x
6) This may be related: https://stackoverflow.com/questions/44569265/php-unlink-on-windows-fails-permission-denied-rename-works. If this is true, and Full Control permissions are required, this is a big security no no! For numerous reasons, IIS web folders should never be set to Full Control.
Update: Tested form using Full Control, didn’t resolve issue.Will continue researching.
- The topic ‘CF7 v5.x issue with removing uploaded files on IIS’ is closed to new replies.