Ciao a tutti,
hdovrei eseguire, su un server locale apache + php (WAMP)
l'upload di alcuni file nel server, e dallo stesso script ottenere indirizzo del file caricato da mettere in un database mysql per utilizzarlo da altre pagine,
su un server linux funziona senza problemi, ma sul server windows escono una serie di errori:
$pinfo) { $option .= ''.$pinfo["name"].''; } return $option; } function check_vals() { global $upload_dirs, $err; if (!ini_get("file_uploads")) { $err .= "HTTP file uploading is blocked in php configuration file (php.ini). Please, contact to server administrator."; return 0; } $pos = strpos(ini_get("disable_functions"), "move_uploaded_file"); if ($pos !== false) { $err .= "PHP function move_uploaded_file is blocked in php configuration file (php.ini). Please, contact to server administrator."; return 0; } if (!isset($_POST["path"]) || (strlen($_POST["path"]) == 0)) { $err .= "Please fill out path"; return 0; } if (!isset($upload_dirs[$_POST["path"]])) { $err .= "Incorrect path"; return 0; } if (!isset($_POST["pwd"]) || (strlen($_POST["pwd"]) == 0)) { $err .= "Please fill out password"; return 0; } elseif ($_POST["pwd"] != $upload_dirs[$_POST["path"]]["password"]) { $err .= "The upload password is incorrect"; return 0; } if (!isset($_FILES["userfile"])) { $err .= "Empty file"; return 0; } elseif (!is_uploaded_file($_FILES['userfile']['tmp_name'])) { $err .= "Empty file"; return 0; } return 1; } $err = ""; $status = 0; if (isset($_POST["upload"])) { if (check_vals()) { if (filesize($_FILES["userfile"]["tmp_name"]) > $max_file_size) $err .= "Maximum file size limit: $max_file_size bytes"; else { if (move_uploaded_file($_FILES["userfile"]["tmp_name"], $upload_dirs[$_POST["path"]]["dir"].$_FILES["userfile"]["name"])) { $status = 1; } else $err .= "There are some errors!"; } } } if (!$status) { if (strlen($err) > 0) echo " $err "; } else { echo " "".$_FILES["userfile"]["name"]."" was successfully uploaded. "; } ?> Welcome to ES Simple Uploader v 1.1. « Back to Product page « (Select folder, set it's password, then select a file to upload and click "Upload" button). Note: Folder: "Images folder", Password: "images"; Folder: "Docs", Password: "docs"; Folder: "Common files", Password: "common"; Maximum file size: Kb. Folder: Password: Choose file: Powered by EnergyScripts Find more power solution: ES File Upload & Download Manag
Come posso risolvere? oppure avete qualche altro script adatto a questo scopo?
Grazie a tutti!