Answer the question
In order to leave comments, you need to log in
How can I prevent the file upload script from downloading a file twice in a row?
Problem:
I have a script from the plupload library that uploads files to the server in small parts in the specified folder, and at the moment the problem is that the mail sender script used to be responsible for this:
$total_count7 = count($_FILES['file-7']['name']);
// Loop through every file
for( $i=0 ; $i < $total_count7 ; $i++ ) {
//The temp file path is obtained
$tmpFilePath = $_FILES['file-7']['tmp_name'][$i];
//A file path needs to be present
if ($tmpFilePath != ""){
//Setup our new file path
$newFilePath = "./uploads/" . $_FILES['file-7']['name'][$i];
//File is uploaded to temp dir
if(move_uploaded_file($tmpFilePath, $newFilePath)) {
$mail->addAttachment("uploads/" . $_FILES['file-7']['name'][$i]);
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question