Witajcie. Od wczoraj męczę się z tym problemem:
Sorry, there was an error uploading your file.
KOD:
$target_dir = "/home/admin/web/jakastamstrona.pl/public_html/acp/upload/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); $uploadOk = 1;
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION
); // Check if image file is a actual image or fake image
if(isset($_POST["submit"])) { if($check !== false) {
echo "File is an image - " . $check["mime"] . "."; $uploadOk = 1;
} else {
echo '<div class="alert alert-danger">File is not an image.</div>'; $uploadOk = 0;
}
}
// Check if file already exists
//if (file_exists($target_file)) {
// echo "Sorry, file already exists.";
// $uploadOk = 0;
//}
// Check file size
if ($_FILES["fileToUpload"]["size"] > 500000) {
echo '<div class="alert alert-danger">Sorry, your file is too large.</div>'; $uploadOk = 0;
}
// Allow certain file formats
// Check if $uploadOk is set to 0 by an error
if ($uploadOk == 0) {
echo '<div class="alert alert-danger">Sorry, your file was not uploaded.</div>'; // if everything is ok, try to upload file
} else {
echo '<div class="alert alert-success">The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded.</div>'; } else {
echo '<div class="alert alert-danger">Sorry, there was an error uploading your file.</div>'; }
}
Folder ma prawa chmod 777 i jest stworzony (IMG:
style_emoticons/default/biggrin.gif)
Proszę o pomoc!