Add attachment dynamic doesn’t work – Not in allowed directory
-
Hello,
since I updated the wordpress site to 5.7.2 (and with it Contact Form 7), adding a file via the code no longer works.
I could also already determine by activating the debug mode that the following error is played: “Failed to attach a file. /tmp/myfilname.xml is not in the allowed directory”. I get this message from the CF7 plugin (includes/mail.php > line 147).
Does anyone here possibly have an idea how I can solve this?
$myfilname_xml = Filled with xml code before
$filename = get_temp_dir() . 'myfilname.xml'; $f = fopen( $filename, 'w+' ); fwrite( $f, $myfilname_xml ); fclose( $f ); $components['attachments'] = array( 'openimmo-feedback' => $filename );
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Add attachment dynamic doesn’t work – Not in allowed directory’ is closed to new replies.