• 14-01-2008, 20:12:40
    #1
    Mrb arkadaşlar KUllanıdığım script

    1. upload.php
    2. upload_ac.php

    Step
    1. Create file upload.php.
    2. Create file upload_ac.php.
    3. Create folder "upload" for store uploaded files.
    4. CHMOD your upload folder to "777" by using your ftp software(change permission).

    Create file upload.php


    ############### Code
                                                    
    <table width="500" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
    <tr>
    <form action="upload_ac.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
    <td>
    <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
    <tr>
    <td><strong>Single File Upload </strong></td>
    </tr>
    <tr>
    <td>Select file
    <input name="ufile" type="file" id="ufile" size="50" /></td>
    </tr>
    <tr>
    <td align="center"><input type="submit" name="Submit" value="Upload" /></td>
    </tr>
    </table>
    </td>
    </form>
    </tr>
    </table>
    Create file upload_ac.php
    <?php
                                                        //set where you want to store files
                                                        //in this example we keep file in folder upload
                                                        //$HTTP_POST_FILES['ufile']['name']; = upload file name
    //for example upload file name cartoon.gif . $path will be upload/cartoon.gif
                                                        $path= "upload/".$HTTP_POST_FILES['ufile']['name'];
                                                        if($ufile !=none)
                                                        {
                                                        if(copy($HTTP_POST_FILES['ufile']['tmp_name'], $path))
                                                        {
                                                        echo "Successful<BR/>";
                                                       //$HTTP_POST_FILES['ufile']['name'] = file name
                                                        //$HTTP_POST_FILES['ufile']['size'] = file size
                                                        //$HTTP_POST_FILES['ufile']['type'] = type of file
                                                        echo  "File Name :".$HTTP_POST_FILES['ufile']['name']."<BR/>";
                                                        echo  "File Size :".$HTTP_POST_FILES['ufile']['size']."<BR/>";
                                                        echo  "File Type :".$HTTP_POST_FILES['ufile']['type']."<BR/>";
                                                        echo "<img src=\"$path\" width=\"150\" height=\"150\">";
                                                        }
                                                        else
                                                        {
                                                        echo "Error";
                                                        }
                                                        }
                                                        ?>
    İşte arkadaşlar kod bu Ben bunla
    http://www.birseyindir.org/save/upload_rename.php
    sadece bilgisayardaki dosyalaırı upload edebiliyorum

    Ben istiyorumki internetteki dosyalarıda yüklesin istiyorum
    msl
    https://www.r10.net/images/misc/vbull...logo_white.gif bu adresi girdiğimdede upload etsin tşk...
    Sunucum Linux Tşk...
  • 15-01-2008, 18:01:36
    #2
    dosyayı tmp'ye direk linkten çek, oradan yeni isim atayarak kendi lokal klasörüne taşı. Normal form uygulamasından pek bir farkı yok.
  • 16-01-2008, 23:49:22
    #3
    Üyeliği durduruldu
    birseyindir adlı üyeden alıntı: mesajı görüntüle
    Mrb arkadaşlar KUllanıdığım script
    1. upload.php
    2. upload_ac.php
    Step
    1. Create file upload.php.
    2. Create file upload_ac.php.
    3. Create folder "upload" for store uploaded files.
    4. CHMOD your upload folder to "777" by using your ftp software(change permission).
    Create file upload.php
    ############### Code
    <table width="500" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
    <tr>
    <form action="upload_ac.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
    <td>
    <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
    <tr>
    <td><strong>Single File Upload </strong></td>
    </tr>
    <tr>
    <td>Select file
    <input name="ufile" type="file" id="ufile" size="50" /></td>
    </tr>
    <tr>
    <td align="center"><input type="submit" name="Submit" value="Upload" /></td>
    </tr>
    </table>
    </td>
    </form>
    </tr>
    </table>
    Create file upload_ac.php
    <?php
                                                        //set where you want to store files
                                                        //in this example we keep file in folder upload
                                                        //$HTTP_POST_FILES['ufile']['name']; = upload file name
    //for example upload file name cartoon.gif . $path will be upload/cartoon.gif
                                                        $path= "upload/".$HTTP_POST_FILES['ufile']['name'];
                                                        if($ufile !=none)
                                                        {
                                                        if(copy($HTTP_POST_FILES['ufile']['tmp_name'], $path))
                                                        {
                                                        echo "Successful<BR/>";
                                                       //$HTTP_POST_FILES['ufile']['name'] = file name
                                                        //$HTTP_POST_FILES['ufile']['size'] = file size
                                                        //$HTTP_POST_FILES['ufile']['type'] = type of file
                                                        echo  "File Name :".$HTTP_POST_FILES['ufile']['name']."<BR/>";
                                                        echo  "File Size :".$HTTP_POST_FILES['ufile']['size']."<BR/>";
                                                        echo  "File Type :".$HTTP_POST_FILES['ufile']['type']."<BR/>";
                                                        echo "<img src=\"$path\" width=\"150\" height=\"150\">";
                                                        }
                                                        else
                                                        {
                                                        echo "Error";
                                                        }
                                                        }
                                                        ?>
    İşte arkadaşlar kod bu Ben bunla
    http://www.birseyindir.org/save/upload_rename.php
    sadece bilgisayardaki dosyalaırı upload edebiliyorum
    Ben istiyorumki internetteki dosyalarıda yüklesin istiyorum
    msl
    https://www.r10.net/images/misc/vbull...logo_white.gif bu adresi girdiğimdede upload etsin tşk...
    Sunucum Linux Tşk...
    bu script ile sadece local dosyaları yükleyebilirsin.çünkü post ederek çalışıyor
  • 18-01-2008, 11:47:59
    #4
    sorunu cevabı bu kodda var dikkatli incele ;

    $img_link = "http://site.com/img.gif";
    $img = file_get_contents($img_link);
    $bol = split("/",$img_link);
    $son = count($bol) - 1;
    $uzanti = $bol[$son];
    $ismi = $bol[$son-1];
    
    
    $ac = fopen("upload/" . $ismi.$uzanti,"a+");
    fwrite($ac,$img);
    fclose($ac);
    kolay gelsin
  • 18-01-2008, 15:23:52
    #5
    Strefx adlı üyeden alıntı: mesajı görüntüle
    sorunu cevabı bu kodda var dikkatli incele ;

    $img_link = "http://site.com/img.gif";
    $img = file_get_contents($img_link);
    $bol = split("/",$img_link);
    $son = count($bol) - 1;
    $uzanti = $bol[$son];
    $ismi = $bol[$son-1];
    
    
    $ac = fopen("upload/" . $ismi.$uzanti,"a+");
    fwrite($ac,$img);
    fclose($ac);
    kolay gelsin
    teşekkurler çok sade ve çalışan bir kod herkezin işine yarayacağına inanıyorum.
  • 19-01-2008, 16:48:13
    #6
    Üyeliği durduruldu
    bu her serverda çalışmayabilir.
    bu şekilde almak yerine
    imagecreatefrompng($adres);
    imagecreatefromjpeg($adres);
    imagecreatefromgif($adres);
    gibi bi kod kullanırsanız daha güzel kullanışlı olur düşüncesindeyim
    -->> fonk örn kullanımı
    PHP: imagecreatefromjpeg - Manual