I have a form where I can upload a file and rename that file, normally jpeg files are uploaded but I need to convert them to .pdf, would there be any way to make it easy with php?
I leave the code where you upload and rename the file
<?php
$target_path = "albaranes/";
$tipo_archivo = $_FILES['uploadedfile']['type'];
$tipo_archivo = explode("/", $tipo_archivo);
$tipo_archivo= '.'.$tipo_archivo[1];
$nombre_archivo= $_POST['albaran'].$tipo_archivo;
$target_path = $target_path.$nombre_archivo;
if (move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "<script type='text/javascript'>
window.location='redireccionar.php';
</script>";
}
else{
echo $target_path;
}
?>