Böyle bir dosya ya da dizin hata veriyor PHP betiği

1 Cevap php

Ben bu php resim jeneratörü http://phpthumb.gxdlabs.com/ kullanmaya çalışıyorum ve ben aşağıda hatayı almaya devam ediyorum.

Warning: imagejpeg() [function.imagejpeg]: Unable to open 'Images/uploaded/thumbnails/' for writing: No such file or directory in D:\Data\Websites\wamp\www\StephsSite\PHP\phpThumb\GdThumb.inc.php on line 672

İşte benim senaryom

 <?php
        require_once 'PHP/phpThumb/ThumbLib.inc.php';

        $options = array('jpegQuality' => 80, 'preserveAlpha' => true);

        try {
            $thumb = PhpThumbFactory::create('Images/Drew.jpg', $options);
        }
        catch (Exception $e) {
            echo "problems...";
        }

        $thumb->adaptiveResize(200,200)->save('Images/uploaded/thumbnails/');   
?>

and here's some of my file structure testThumb.php/Images/uploaded/thumbnails

1 Cevap

Images/uploaded/thumbnails/ dizin var yok: Üzgünüm, ben sormak zorundayım?

İkinci bir düşünce olarak, hata da onu yazmak için directory açmaya çalışıyor olduğunu belirtmek gibi görünüyor. Eğer save bir dosya adını gerekmez emin misiniz?

Aslında, ben öyle düşünüyorum. Dan this page:

Görüntüleri Kaydetme: görüntüleri kaydetme oldukça kolaydır. Yalnızca (dosya adı dahil) görüntüyü kurtarmak fonksiyon kaydetmek istediğiniz yere tam yolu geçmek gerekir.

Yani, böyle bir şey denemek istiyorum:

<?php
    require_once 'PHP/phpThumb/ThumbLib.inc.php';
    $options = array('jpegQuality' => 80, 'preserveAlpha' => true);
    try {
        $thumb = PhpThumbFactory::create('Images/Drew.jpg', $options);
    } catch (Exception $e) {
        echo "problems...";
    }
    $thumb->adaptiveResize(200,200)->save('Images/uploaded/thumbnails/Drew.jpg');   
?>