5
OK my intention with the modifications to the mydownloads module are that my users can select a file from there own machine via their local file browser and that this file is transparently uploaded to the server location without them needing to specify the URL. So I've incorporated code from
mydl_fileup100 that supplies the file browser, hidden the line that asks for the URL and replaced the default value of "http://" with a hard coded URL as described above.
FWIW I've now located the source of the Error 1016 also described above:
[b]from [i]mydownloads/submit.php[/i][/b]
// Check if URL exist
if (($HTTP_POST_VARS["url"]) || ($HTTP_POST_VARS["url"]!="")) {
$url = $HTTP_POST_VARS["url"];
}
// Add start by bluemooninc.biz
$upfile = $_FILES['upfile']; //upload file object
$upfile_tmp = $_FILES['upfile']['tmp_name']; //tmp file name
$upfile_name = $_FILES['upfile']['name']; //Local File Name
$upfile_size = $_FILES['upfile']['size']; //File Size
$upfile_type = $_FILES['upfile']['type']; //File MIME Content-Type
if ($upfile_tmp != "" && ( is_object($xoopsUser) || GUEST_UPLOAD==1) ){
if (eregi($subtype, $upfile_type)){ $deny=0; } else { $deny=1; };
$ext = strtolower(end(explode(".",$upfile_name)));
if (eregi($viri, $ext)) $deny = 1;
if ($deny==0) {
$upfile_localname = $upfile_name;
$upfile_url=XOOPS_URL.UPLOADS.rawurlencode($upfile_localname); // XOOPS_UPLOAD_URL.
$upfile_localname = cnv_mbstr($upfile_localname); // convert for mbstrings
copy($upfile_tmp,XOOPS_ROOT_PATH.UPLOADS.$upfile_localname);
$url = $upfile_url;
} else {
$url = "";
}
}
// Add end
if ($url=="") {
$eh->show("1016");
}
Now, while I understand what its trying to do I'm really stretched to understand what the detail of it means. Some seems redundant but I'm no programmer of any language, let alone php.