9
I'm trying a little hacks:
add to the submit template the html code at the end
<form enctype="multipart/form-data" method="post" action="submit.php">
<input type="hidden" name="MAX_FILE_SIZE" value="5000000" />
Carica il file:
<input type="file" name="fileutente" />
<input type="submit" />
</form>
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:<br/>".$_FILES['fileutente']['error'];
}
}
The template have also another variable with the new name of uploaded file.
What you think?