I use this code to move my uploaded files into the uploads folder before cf7 gets chance to delete them. I also add a random string to the start of the filename so that there is almost no risk of duplicated file names.
function update_event(){
$random = date(DATE_ATOM, mktime(0, 0, 0, 7, 1, 2000)).rand(0,10000);
$eventImgClean = "/".$random.str_replace("/home/website/public_html/wp-content/uploads/wpcf7_uploads/","",$cf7->uploaded_files['event-image']);
$eventImg = $cf7->uploaded_files['event-image'];
if (strlen($eventImg)<1) {
$eventImg = FALSE;
}
else {
//make sure the image is below 1Mbyte
if (filesize($eventImg) < 1048576){
copy($eventImg, "wp-content/uploads/".$eventImgClean);
$evImg = "/wp-content/uploads/".$eventImgClean;
$filesize1_ok = TRUE;
} else {
$filesize1_ok = FALSE;
}
}
//do extra stuff here
}
add_action('wpcf7_before_send_mail', 'update_event');