Thank you very much, the upload of a PDF file works excellently. My question: I want to know if it is possible to rename the file that has been uploaded based on the input from another field, such as the ‘Name’ field. How would one go about doing this?
]]>I’ve found several similar questions but couldn’t find the solution to my problem so I hope someone can help me with this.
I simply want someone to upload a photo of themselves and add the url in between the <img />-tag somewhere in the e-mail that is being sent out.
I’m using the following code to create an [attachment_url] tag which I hope will generate the full url of the attachment so I can use it in between the <img />-tag as mentioned
function wpcf7_tag_attachment_url($output, $name, $html, $url)
{
$name = preg_replace('/^wpcf7\./', '_', $name); // for back-compat
$submission = WPCF7_Submission::get_instance();
if (! $submission) {
return $output;
}
if ('attachment_url' == $name) {
return $url; // Where and how do I get the full URL here?
}
return $output;
}
add_filter('wpcf7_special_mail_tags', 'wpcf7_tag_attachment_url', 10, 3);
]]>
I’ve used the code below to select a different folder then the default Media Library for saving my uploaded files from the contactform7 form I’ve made.
function define_cf7_upload_dir( $fullFileName ){
$fileName = basename($fullFileName);
//replace $myDir with your own folder
$myDir = "./wp-content/uploads/wpcf7_uploads/";
$fullURL = $myDir . $fileName;
return $fullURL;
}
add_filter('nmr_create_attachment_file_name', 'define_cf7_upload_dir');
This works well, the only problem I have is that somewhere it still files it as an empty icon in the Media Library and creates all the thumbnail versions as well.
Fully compatible to wp 6.2.2 ?
Thanks!
Hi,
I check your existing forums regarding getting uploaded file url in email. But didn’t find any complete information or steps on how and where to use your instructions.
I think there should be a short code to get current upload file url. So that we can use the same in email body to add link of uploaded file in email before sending email.
Or you can provide the code to add the same for time being here and later on release your updated code in your plugin to include url in email body to get uploaded file path and new name through any shortcode.
That would be very helpful for all of us. because attaching the upload file will consume whole provided space of email slowly. And no one would like that. So adding upload file path in email body is best option.
Thanks in advance. Hope to hear good from you.
Thanks
]]>If two files are uploaded with the same name, the plugin seems to allow both files to keep that name. The normal media library behavior is to add a number before the extension for a duplicated name.
Is this a case we need to handle on our own using something like wp_unique_filename?
]]>Hi im using wpcf7_before_send_mail to create a draft post when submitting a contact form 7 entry. Im using this plugin to save the image file used in the cf7 entry which uploads it to the media library fine.
however im sturggling to find a way of then grabbing that image from the media library and setting it as a featured image for that post?
my data looks like this
`$my_post = array(
‘post_title’ => $posted_data[‘testimonial-title’],
‘post_content’ => $posted_data[‘testimonial-content’],
‘post_status’ => ‘publish’,
‘post_type’ => ‘living’,
);
wp_insert_post($my_post);
is there a filter what i can use to give me the id of the image so i can attach it like this?
set_post_thumbnail( $post_id, IMAGE ID TO GO HERE);
]]>My contact form 7 page works great until I activate Store file uploads for Contact Form 7. The file does get saved in the media library but the progress wheel beside the Submit button spins forever and the message never gets sent. Any ideas?
Thanks,
Mark
]]>I just installed this plugin today and I am very happy with it. My question is, is there a way to populate the attributes such as alternate text, caption, and description when the file is placed in the media library? I have added fields to my contact form to capture this data, but I have not seen a way to apply it.
Thanks again for a great plugin.
Mark
]]>Hey i use your plugin. But i dont understand how to get the Image saved from my Formular to a other side.
Where can i find the attachement id of the image or the URL in Database (Just the Ids or URLs from the specific formular)? Or better what do i need to do in php to get all images an show them on my page.
I allready use flamingo to save my data. It save a string for the image. But i think this issnt the attachement_id.
]]>Hi
is work with Multiline files upload for contact form 7 ?
hello, i have a problem with implementing my own function into wordpress. I have this plugin and I need to display / add link to the file uploaded by the form. I used the code sent 2 threads before but I don’t know exactly where to add this code:
// The action callback function.
function example_callback_id_generated( $attachment_id ) {
// (maybe) do something with the args.
$url = wp_get_attachment_url( $attachment_id );
}
add_action( 'nmr_create_attachment_id_generated', 'example_callback_id_generated', 10, 1 );
Adding it to the functions.php file in the themes directory I get a fatal wordpress error.
I then added it to the file: store-file-uploads-for-contact-form-7.php, But when calling it as “[nmr_create_attachment_id_generated]” I get plain text – no location ….
I want the file location to show up in the textbox.
]]>Hi,
I’ve just started experimenting with this plugin and it looks like it will meet my needs very well. Thank you for your work.
I have a form that just requires a file upload and I’m using the ‘nmr_create_attachment_file_name’ hook to set the filename to a required format. I note that when no email is sent by the form such as when skip_mail:on is set in CF7 Additional Settings then the uploaded file is not saved.
Is this the expected outcome if no email is sent?
My workaround is to enable mail to be sent in the CF7 form. The email address is a forwarder on my site that is set to ‘discard’ using cPanel -> Forwarders -> Add Forwarder -> Advanced Options -> Discard
I’m asking just to clarify what I’ve assumed to be correct given your description:
“This plugin will save uploaded files to Media Library before email is sent by CF7.”
Thanks and best regards
]]>Hello. How can I get the URL of the file at the time of sending the email?
Can you help me with this? Thanks!
Hi,
We rewrote the plugin a bit to change direction where files are saved. I have a question, what if the plugin will be updated? Will it rewrite our changed code? If so can we block auto update?
]]>This is a nice plugin but it will be nicer if it could work with “Clean image filenames” plugin or have the functionality to clean the images names from strange characters.
]]>Hello, is there an option to choose directory where files are being stored? I would like to create a specific folder just for files from my form.
]]>Hi everybody,
the upload Files have no File-Type, no Preview and always a filesize between 12KB and 64 Bytes.
Tested it on two diffrent systems, wirh two different Themes.
Do i have to set up some settings?
]]>Hi I have multiple contact forms on my site can I restrict this plugin to only capture the uploads from a certain contact form ID
]]>Hi !
Very great plugin ??
I would like to use it to display the stored file URL in the sent e-mail (instead of sending the file). Is this a feature ? If not, can you please implement it ? It would be a fantastic feature.
And a suggestion : if a user uploads a file with the same name (for example DSC_0001.jpg, witch is common), the first uploaded file will be overwritten. Can you rename the file with a random name ?
Best Regards
swissboy1984