Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem ze zmianą wymiaru zdjęcia, Mam problem z ikonką
mzakrzewski
post
Post #1





Grupa: Zarejestrowani
Postów: 13
Pomógł: 0
Dołączył: 29.12.2016

Ostrzeżenie: (0%)
-----


Ogółnie próbuję zrobić domyślny rozmiar zdjęcia np 880 na 480

Wiec tak to jest kod

  1. if(isset($_FILES["ikonka_produktu_torby"]))
  2. {
  3. $extension = explode('.', $_FILES['ikonka_produktu_torby']['name']);
  4. $new_name = rand() . '.' . $extension[1];
  5. $destination = './upload/' . $new_name;
  6. $path = $_FILES['ikonka_produktu_torby']['tmp_name'];
  7. $_FILES["ikonka_produktu_torby"] = strtolower(pathinfo($path,PATHINFO_EXTENSION));
  8. move_uploaded_file($_FILES['ikonka_produktu_torby']['tmp_name'], $destination);
  9. switch ($_FILES["ikonka_produktu_torby"]) {
  10. case "jpg":
  11. case "jpeg":
  12. $iko = MakeIco ($destination.$extension, 880, 480);
  13. imagejpeg ($iko, $destination.$extension, 100);
  14. break;
  15. case "gif":
  16. $iko = MakeIco ($destination.$extension, 880, 480);
  17. imagegif ($iko, $destination.$extension);
  18. break;
  19. case "png":
  20. $iko = MakeIco ($destination.$extension, 880, 480);
  21. imagepng ($iko, $destination.$extension);
  22. break;
  23. }
  24. return $new_name;
  25. }


a i błąd mam taki:

: Illegal string offset 'tmp_name' in 13

a linia 13 to:

move_uploaded_file($_FILES['ikonka_produktu_torby']['tmp_name'], $destination);


a var_dump pokazuje mi


string(3) "tmp"


a folder tmp jest

można jakąś pomoc

Ten post edytował mzakrzewski 22.04.2017, 17:51:26
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 14.09.2025 - 20:43