Jump to content

Asumi

New Members
  • Posts

    5
  • Joined

  • Last visited

Asumi's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Well, was testing some possibilities and i read again this line ; And I told me, well, gonna try to change the permissions via ssh on these directories. So i did; chown -R www-data:www-data Sous-titres and; chmod -R 777 Sous-titres And now, it's work ! Thank's very much WinstonLA ! You are a god PS: I changed thise line on folder creation; $oldumask = umask(002);
  2. Well, i did what you say, and had this; bool(true) string(26) "Sous-titres/Akame ga kill/" Sorry, there was an error uploading your file. So if i understand right, the directory exists , but the upload can't be done for some reason ? Ok Ch0cu3r ! Good to know
  3. The problem is the spaces in the directory "Akame ga kill", in debian, for cd to that directory i need to do cd Akame\ Ga\ Kill. So i thinked that i needed to add the slashes with the str_replace here ; $anime = $file = str_replace(' ', '\ ', $anime); I can't really don't use spaces here, because the directory is created with the Anime name, when the Admin create a new one, and most of the animes have a composed name. (Well, i can tell to admins to use CamelCase for example, but i'm sure that we can deal with this problem !)
  4. Hey WinstonLA, thank's for the answer, i had a problem like that at the beginning and corrected it, like the permissions are; drwxrwxrwx www-data www-data The problem is, if i replace this line : $anime = "Sous-titres/".$anime."/"; With this: $anime = "Sous-titres/$anime"; My file is uploaded, but on the directory "Sous-titres", and the filename is something like "Akame\ ga\ killFilename.jpg", don't know what is wrong The directory have the same permissions than Sous-titres. Activating the error_reporting;
  5. Heya all, as the title says, i meet some issues when uploading files to my server, here is the code; $anime = $_POST['anime']; $anime = $file = str_replace(' ', '\ ', $anime); $anime = "Sous-titres/".$anime."/"; $target_dir = $anime; $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); $uploadOk = 1; if(isset($_POST["submit"])) { // Check if file already exists if (file_exists($target_file)) { echo "Sorry, file already exists."; $uploadOk = 0; } // Check file size if ($_FILES["fileToUpload"]["size"] > 50000000) { echo "Sorry, your file is too large."; $uploadOk = 0; } // Check if $uploadOk is set to 0 by an error if ($uploadOk == 0) { echo "Sorry, your file was not uploaded."; // if everything is ok, try to upload file } else { if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) { echo "The file " . basename($_FILES["fileToUpload"]["name"]) . " has been uploaded."; } else { var_dump ($target_dir); echo "Sorry, there was an error uploading your file."; } } } So, i'm attempting to acces to a directory taking the name of the anime that the admin put in the input type="text", for upload the file selected in. Error with the var_dump: string(28) "Sous-titres/Akame\ ga\ kill/" Sorry, there was an error uploading your file. Hope you can help me !
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.