Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] Problem z zapisem... :/
serv
post 12.12.2008, 20:12:14
Post #1





Grupa: Zarejestrowani
Postów: 35
Pomógł: 0
Dołączył: 19.01.2007
Skąd: Gorzów Wielkopolski

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


Witam!

Mam problem z zapisem pliku poprzez taki kodzik:
  1. <?php
  2. $file = 'File'.$licz;
  3. if (!empty($_FILES[$file]['tmp_name'])) {
  4. echo $file;
  5. $width = 500;
  6. $height = 500;
  7. $images_res = $_FILES[$file]['tmp_name'];
  8. $path_res = '../images/';
  9. $name = $_FILES[$file]['name'];
  10.  
  11. $filename = $images_res;
  12.  
  13.  
  14. list($width_orig, $height_orig) = getimagesize($filename);
  15.  
  16. $ratio_orig = $width_orig/$height_orig;
  17.  
  18. if ($width/$height > $ratio_orig) {
  19.   $width = $height*$ratio_orig;
  20. } else {
  21.   $height = $width/$ratio_orig;
  22. }
  23.  
  24. $image_p = imagecreatetruecolor($width, $height);
  25. $image = imagecreatefromjpeg($filename);
  26. imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
  27.  
  28. // Output
  29. imagejpeg($image_p, $path_res . $conf, 75);
  30. ?>


Wyświetla mi błąd :
Cytat
Warning: imagejpeg() [function.imagejpeg]: Unable to open '../images/' for writing: No such file or directory in (...)


Oczywiście na folder images ustawiłem prawa 777.

Pozdrawiam!
Go to the top of the page
+Quote Post
memory
post 12.12.2008, 20:26:44
Post #2





Grupa: Zarejestrowani
Postów: 616
Pomógł: 84
Dołączył: 29.11.2006
Skąd: bełchatów

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


imagejpeg($image_p, $path_res . $conf, 75); zdaje mi sie ze jeszcze przydala by sie nazwa pliku
Go to the top of the page
+Quote Post
serv
post 12.12.2008, 20:30:04
Post #3





Grupa: Zarejestrowani
Postów: 35
Pomógł: 0
Dołączył: 19.01.2007
Skąd: Gorzów Wielkopolski

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


Ahhh pomyliłem zmienną... sorry i dzięki smile.gif
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 12.07.2025 - 10:36