Ok estoy por finalizar un formulario de envio de archivos por email.
el metodo que estoy utilizando es el de subir al servidor y de alli enviarlos por email.
Entonces cree una carpeta fisica en mi servidor ftp y puse el siguiente codigo:
Código PHP:
<?php
$sendTo = "[email protected]";
$subject = "Curriculum";
$telefono = $_POST["telefono"];
$archivo = $_FILES["archivo"];
$email = $_POST["email"];
$nombre = $_POST["nombre"];
$headers .= "";
$message = "Nombre: " . $nombre . "\nTelefono: " . $telefono . "\nCurriculum: " . $archivo . "\nEmail: " . $email;
mail($sendTo, $subject, $message, $headers);
if (!empty($_FILES)) {
$tempFile = $_FILES['archivo']['tmp_name'];
$carpetaArchivosSubidos = "subidos";
$targetPath = $_SERVER['DOCUMENT_ROOT'].$carpetaArchivosSubidos. '/';
$targetFile = str_replace('//','/',$targetPath) . $_FILES['archivo']['name']; // $_FILES['archivo']['name'] contiene el nombre del archivo original; utiliza echo o print para mostrarlo.
echo $_FILES['archivo']['name'];
// Quita el comentario de la siguiente línea para crear la carpeta:
//mkdir(str_replace('//','/',$targetPath), 0755, true);
mkdir("/ftpinter/intersystem-arg.com/subidos/", 0700);
move_uploaded_file($tempFile, $targetFile);
// La siguiente línea muestra la ruta y el nombre del archivo en el servidor (descomentala para ver):
echo str_replace($_SERVER['DOCUMENT_ROOT'],'',$targetFile);
}
?>
Pero me tira los siguientes errores:
Cita:
canchas.txt
Warning: mkdir(/ftpinter/intersystem-arg.com/subidos/): No such file or directory in E:\webspace\intersystem\ftpinter\intersystem-arg.com\www\formulario.php on line 56
Warning: move_uploaded_file(subidos/canchas.txt): failed to open stream: No such file or directory in E:\webspace\intersystem\ftpinter\intersystem-arg.com\www\formulario.php on line 58
Warning: move_uploaded_file(): Unable to move 'C:\PHP\uploadtemp\php245D.tmp' to 'subidos/canchas.txt' in E:\webspace\intersystem\ftpinter\intersystem-arg.com\www\formulario.php on line 58
subidos/canchas.txt
Warning: mkdir(/ftpinter/intersystem-arg.com/subidos/): No such file or directory in E:\webspace\intersystem\ftpinter\intersystem-arg.com\www\formulario.php on line 56
Warning: move_uploaded_file(subidos/canchas.txt): failed to open stream: No such file or directory in E:\webspace\intersystem\ftpinter\intersystem-arg.com\www\formulario.php on line 58
Warning: move_uploaded_file(): Unable to move 'C:\PHP\uploadtemp\php245D.tmp' to 'subidos/canchas.txt' in E:\webspace\intersystem\ftpinter\intersystem-arg.com\www\formulario.php on line 58
subidos/canchas.txt
Y por mucho que lei no logro solucionarlos. alguna ayuda?
GRACIAS