Rating: 5 stars
Works as expected out of the box.
]]>Rating: 5 stars
Solved my issue without problem, works fine from installation
]]>Rating: 5 stars
I am getting error while submitting to CF7.
Note: I am trying to upload MP3 files
<pre>fatal error:
Array
(
[type] => 1
[message] => Uncaught Error: Call to undefined function wp_read_audio_metadata() in /home/theuxm/html/wp-admin/includes/image.php:489
Stack trace:
#0 /home/theuxm/html/wp-content/plugins/store-file-uploads-for-contact-form-7/store-file-uploads-for-contact-form-7.php(39): wp_generate_attachment_metadata()
#1 /home/theuxm/html/wp-content/plugins/store-file-uploads-for-contact-form-7/store-file-uploads-for-contact-form-7.php(55): nmr_create_attachment()
#2 /home/theuxm/html/wp-includes/class-wp-hook.php(305): nmr_on_before_cf7_send_mail()
#3 /home/theuxm/html/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
#4 /home/theuxm/html/wp-includes/plugin.php(518): WP_Hook->do_action()
#5 /home/theuxm/html/wp-content/plugins/contact-form-7/includes/submission.php(617): do_action_ref_array()
#6 /home/theuxm/html/wp-content/plugins/contact-form-7/includes/submission.php(86): WPCF7_Submission->before_send_mail()
#7 /home/theuxm/html/wp-content/plugins/contact-form-7/includes/submission.php(27): WPCF7_Submission->proceed()
#8
[file] => /home/theuxm/html/wp-admin/includes/image.php
[line] => 489
)
</pre>
]]>
Rating: 5 stars
It works and that’s it
]]>Rating: 5 stars
Thanks! I spent a day wondering why the temporary file was not longer there then another day finding out that CF7 is moving that file. So this is exactly what I was trying to figure out. It does look like files could be overwritten if they are uploaded with an existing name. You can probably do something like the following to ensure files get unique names and are not overwritten.
// Get the path to the upload directory.
$wp_upload_dir = wp_upload_dir();
$upload_path = $wp_upload_dir['path'];
$unique_filename = wp_unique_filename($upload_path, basename($filename));
$attachFileName = $upload_path . '/' . $unique_filename;
copy($filename, $attachFileName);
// Prepare an array of post data for the attachment.
$attachment = array(
'guid' => $attachFileName,
'post_mime_type' => $filetype['type'],
'post_title' => preg_replace('/\.[^.]+$/', '', $unique_filename),
'post_content' => '',
'post_status' => 'inherit'
);
]]>
Rating: 5 stars
It works perfect, no config needed.
]]>