• 11-09-2006, 10:17:29
    #1
    Merhaba;

    Dosya tipine göre yükleme kodum aşağıda.
    ($HTTP_POST_FILES['userfile']['type']=="image/gif") || ($HTTP_POST_FILES['userfile']['type']=="image/pjpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/jpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/png")
    Ama bir türlü png dosyası yükleyemiyorum. Bir yanlışlık mı var acaba? Jpg ile gif'te problrm yok.
  • 11-09-2006, 10:27:07
    #2
    Dosya uzantısı kontrol ettir daha kolay olur.
    Birde gd library versiyonuna kurulu olup olmadığına bak genelde 2.0 default olarak geliyor ama sen yinede
    <? phpinfo(); ?> ile bi kontrol et
  • 11-09-2006, 10:47:27
    #3
    GD :


    GD Support 	enabled
    GD Version 	bundled (2.0.28 compatible)
    FreeType Support 	enabled
    FreeType Linkage 	with freetype
    GIF Read Support 	enabled
    GIF Create Support 	enabled
    JPG Support 	enabled
    PNG Support 	enabled
    WBMP Support 	enabled
    XBM Support 	enabled
  • 11-09-2006, 22:13:26
    #4
    Aklıma gelen başka birşey yok bence dosya uzantısı kontrol ettir daha kolay olur sanırım
  • 12-09-2006, 00:41:51
    #5
    bu sekilde calisiyor, bir kontrol et bakalim gözden kacirdiğin bir nokta olabilir. tavsiye olarak $HTTP_POST_FILES yerine $_FILES kullan .

    <?
    
    if (isset($_POST['submit']))
    {
    if (($HTTP_POST_FILES['userfile']['type']=="image/gif") || ($HTTP_POST_FILES['userfile']['type']=="image/pjpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/jpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/png"))
    { echo 'dosya türü uygun<br />'.$_FILES['userfile']['name']; } 
    else 
    { echo 'dosya uyumsuz.'; }
    }
    else
    {
    ?>
    <form action="" method="post" ENCTYPE="multipart/form-data">
    <br><input type="file" size="30" name="userfile" />
    <br><input type="submit" name="submit" value="Resimleri Yükle">
    </form>
    
    <? } ?>
  • 12-09-2006, 16:38:32
    #6
    Tamam. Teşekkürler. Olay çözüldü.