hi michael, here is the code i added to my function.php (after i comment out the lines in cf7 code, prev):
function cfdbFilter($formData){
$formName='Dummy form';
$uploaddir='http://localhost/smc/wp/wp-content/uploads/wpcf7_uploads'; // note: modify htaccess of "wpcf7_uploads"
if($formData && $formName == $formData->title){
$formData->posted_data['form-attachment']=$uploaddir.'/'.$formData->posted_data['form-file'];
unset($formData->posted_data['form-file']);
unset($formData->uploaded_files['form-file']);
}
return $formData;
}
add_filter('cfdb_form_data','cfdbFilter');
a different approach:
also, i looked at the code of both plugins, trying to see where the 'write to db' happens (and also the 'send', in the case of cf7). and as with the previous instructions, i commented out code in cf7 and i also tried to comment out this part of "CF7DBPlugin.php":
if ($filePath) {
/*$content = file_get_contents($filePath);
$wpdb->query($wpdb->prepare($parametrizedFileQuery,
$content,
$time,
$title,
$nameClean,
$valueClean));*/
}
(lines 520 to 528)
and
if (!in_array($field, $foundUploadFiles) && $filePath) {
/*$fileName = basename($filePath);
$wpdb->query($wpdb->prepare($parametrizedQuery,
$time,
$title,
$field,
$fileName,
$order++));
$content = file_get_contents($filePath);
$wpdb->query($wpdb->prepare($parametrizedFileQuery,
$content,
$time,
$title,
$field,
$fileName));*/
}
(lines 536 to 551)
finally, for the filter in function.php, i just added the path to "form-file" and did not unset anything.
the result is my desired effect, except of course, it is "ugly" since it tinkers directly with the code of both plugins. i was able to save the attachment from the cf7 form in the filesystem, save the path (and not the file itself) to the cfdb table, and also receive the attachment in the test email.