9
I'm trying a little hacks:
add to the submit template the html code at the end
then in submit.php:
# line 41
$file_url = "http://";
if (!empty($_FILES['fileutente'])) {
$file_name = basename($_FILES['fileutente']['tmp_name']);
$file_info = pathinfo($_FILES['fileutente']['name']);
# add extension
if ($file_info['extension']) {
$file_name = $file_name.".".$file_info['extension'];
}
# compose url path
$file_url = XOOPS_URL."/modules/mydownloads/updates/".$file_name;
if (move_uploaded_file($_FILES['fileutente']['tmp_name'],"uploads/".$file_name)) {
$debug_txt = "File uploaded";
}
else {
$debug_txt = "Error while upload file:
".$_FILES['fileutente']['error'];
}
}
The template have also another variable with the new name of uploaded file.
What you think?