• 10-02-2015, 00:13:01
    #1
    Toplam 17 satırlık bir PHP kodumuz var. Asp ye çevirebilir misiniz.
    Bir multi upload kodu Persit kullanılabilir.
  • 10-02-2015, 00:25:09
    #2
    Yazda bakalım bir
  • 10-02-2015, 08:32:45
    #3
    BigCoder adlı üyeden alıntı: mesajı görüntüle
    Yazda bakalım bir

    <?php  
    // İzin verilen dosya uzantıları listesi
    $allowed = array('png', 'jpg', 'gif','zip','rar');
    if(isset($_FILES['upl']) && $_FILES['upl']['error'] == 0){
        $extension = pathinfo($_FILES['upl']['name'], PATHINFO_EXTENSION);
        if(!in_array(strtolower($extension), $allowed)){
            echo '{"status":"error"}';
            exit;
        }
        if(move_uploaded_file($_FILES['upl']['tmp_name'], 'uploads/'.$_FILES['upl']['name'])){
            echo '{"status":"success"}';
            exit;
        }
    }
    echo '{"status":"error"}';
    exit;
    ?>
  • 10-02-2015, 17:40:51
    #4
    <%
    Set Upload = Server.CreateObject("Persits.Upload")
    Path = Server.MapPath("/Uploads/Images/")
    
    Count = Upload.Save(Path)
    
    If Count = 0 Then
    	Response.Write("{""status"":""error""}")
    Else
    	Set File = Upload.Files(1)
    	DosyaAdi = File.filename
    
    	If Right(DosyaAdi,4) = ".jpg" Or Right(DosyaAdi,4) = ".gif"  Or Right(DosyaAdi,4) = ".png" Then ' Kabül Edilen dosya tiplerini kendin ayarla
    	Response.Write("{""status"":""success""}")
    	Else
    	File.Delete
    	Response.Write("{""status"":""error""}")
    	End If
    End If
    Set Upload = Nothing
    %>


    --R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 17:40:51 -->-> Daha önceki mesaj 17:26:11 --

    Mesele php den asp ye çevirmek değil mesele o kodların ne iş yaptığını bilip
    ona göre bir asp kodlama yapmak.
  • 11-02-2015, 16:51:46
    #5
    BigCoder adlı üyeden alıntı: mesajı görüntüle
    <%
    Set Upload = Server.CreateObject("Persits.Upload")
    Path = Server.MapPath("/Uploads/Images/")
    
    Count = Upload.Save(Path)
    
    If Count = 0 Then
        Response.Write("{""status"":""error""}")
    Else
        Set File = Upload.Files(1)
        DosyaAdi = File.filename
    
        If Right(DosyaAdi,4) = ".jpg" Or Right(DosyaAdi,4) = ".gif"  Or Right(DosyaAdi,4) = ".png" Then ' Kabül Edilen dosya tiplerini kendin ayarla
        Response.Write("{""status"":""success""}")
        Else
        File.Delete
        Response.Write("{""status"":""error""}")
        End If
    End If
    Set Upload = Nothing
    %>


    --R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 17:40:51 -->-> Daha önceki mesaj 17:26:11 --

    Mesele php den asp ye çevirmek değil mesele o kodların ne iş yaptığını bilip
    ona göre bir asp kodlama yapmak.

    Doğru diyorsun haklısın. Multi upload diye kısaca açıklamışım. Bu kod php ile sürükle bırak şeklinde bir upload sisteminin kodu. Ben asp de kullanmayı düşünüyordum. Döngü içinde upload olayını bilmiyorum. Html kısmı da attaki gibi.

    Kodu çalıştıramadım zaten Upload yapıyor ama yüklenmiş bir dosya yok. Biraz uğraşayım bakalım.

    <!DOCTYPE html>
    <html>
    
    <head>
            <meta charset="utf-8"/>
            <title>File Upload Form</title>
            <!-- Google web fonts -->
            <link href="https://fonts.googleapis.com/css?family=PT+Sans+Narrow:400,700" rel='stylesheet' />
            <!-- The main CSS file -->
            <link href="assets/css/style.css" rel="stylesheet" />
    </head>
    
    <body>
    
    <form id="upload" method="post" action="upload.asp" enctype="multipart/form-data">
                <div id="drop">
                    <p>Bu alana dosyalarınızı sürükleyin</p>
                    <a>Göz at</a>
                    <input type="file" name="upl" multiple />
                </div>
                <ul>
                    <!-- Yüklenen dosyalar burada listelenecek -->
                </ul>
    </form>
    <!-- JavaScript Includes -->
            <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
            <script src="assets/js/jquery.knob.js"></script>
    <!-- jQuery File Upload Dependencies -->
            <script src="assets/js/jquery.ui.widget.js"></script>
            <script src="assets/js/jquery.iframe-transport.js"></script>
            <script src="assets/js/jquery.fileupload.js"></script>
    <!-- Our main JS file -->
            <script src="assets/js/script.js"></script>
     
    
    </body>
    </html>