النتائج 1 إلى 2 من 2

الموضوع: سؤال عن دالة كوبي

  1. #1

    سؤال عن دالة كوبي



    هاك التحميل اللي يندمج مع الفي بي download2
    لدي كتب بحجم 8 جيجا
    ويتم أخذ باك اب يومي للمنتدي ومعاه الكتب حتي أعيتني :eek3:

    فأريد نقل الملفات للخارج
    جربت وضع الكود التالي في ال htaccess في مجلد الملفات المرفوعة

    كود PHP:
    RewriteEngine On
    RewriteCond 
    %{HTTP_HOST} ^www.example.com [nc]
    RewriteRule ^(.*)$ http://www.example2.com/$1 [R=301,L] 
    يعمل بشكل ممتاز لو بحمل من المتصفح مباشرة
    لكن عبر الهاك بيطلع إيرور

    الهاك يحفظ الملفات ويخفي اللنك من اللي يحمل
    وأعتقد يستخدم الدالة copy
    فهل من حل أو أفكار ؟

    لدي طريقة من خيارات الهاك
    ولكنها تعرض الرابط الحقيقي للملف مما قد يؤدي لنشر الملفات في المواقع وسحب الترافيك
    أريد إخفاء اللنك ولكن ايضا يكون في مسار خارجي

    كيف ذلك





    __________________
    السيف أصدق أنباء من الكتب


  2. #2


    يمكن قراءة الملف
    من أول السطر 650 لمعرفة الدالة المستخدمة في التحميل

    كود PHP:
                if ($file['link'] == 0)
                {
                    if (
    is_dir($dl->url."/ec_tmp/"))
                    {
                        if (
    $dh opendir($dl->url."/ec_tmp/"))
                        {
                            
    // iterate over file list
                            
    while (($filename readdir($dh)) !== false)
                            {
                                
    //if (preg_match("/dlver-/",$filename))
                                //{
                                
    @unlink($dl->url."/ec_tmp/".$filename); // secure download, delete the files
                                //}
                            
    }
                            
    // close directory
                            
    closedir($dh);
                        }
                    }

                
    // hook for post-download checks
                
    ($hook vBulletinHook::fetch_hook('dl_post_download')) ? eval($hook) : false;

                    
    $ext strtolower(substr($dl->url.$file['url'], strrpos($dl->url.$file['url'], '.')+1));
                    if (
    $dl->renamefiles)
                    {
                        
    $newfilename preg_replace('/[^\sA-Za-z0-9\&\(\)\-\_\+\{\[\}\]\,\.]+/','',$file['name']).'.'.$ext;
                    }
                    else
                    {
                        
    $newfilename preg_replace('/[0-9]+-/','',$file['url']);
                    }


                    
    /* $random = "ec_";
                    for ($i = 1; $i <= 3; $i++)
                    {
                        switch(rand(1,3))
                        {
                            case 1: $random.=chr(mt_rand(48,57)); break;  // 0-9
                            case 2: $random.=chr(mt_rand(65,90)); break;  // A-Z
                            case 3: $random.=chr(mt_rand(97,122)); break; // a-z
                        }
                    } */

                    // for sites without safe mode on, create the ec_tmp folder
                    
    if (!is_dir($dl->url."/ec_tmp/"))
                    {
                        
    mkdir($dl->url."/ec_tmp");
                    }

                    
    $dlfilename $dl->url."/ec_tmp/".$newfilename;
                    
    copy($dl->url.$file['url'],$dlfilename);

                            
    // test download code

                            /* $filename = $_GET['file']; */
                            
    $filename $dlfilename;
                            
    // required for IE, otherwise Content-disposition is ignored
                            
    if (ini_get('zlib.output_compression'))
                            {
                                
    ini_set('zlib.output_compression''Off');
                            }
                            
                            
    // addition by Jorg Weske
                            
    $file_extension strtolower(substr(strrchr($filename,"."),1));

                            if (
    $filename == '')
                            {
                                echo 
    "<html><head><title>DownloadsII</title></head><body>ERROR: download file NOT SPECIFIED.</body></html>";
                                exit;
                            }
                            else if (!
    file_exists($filename))
                            {
                                echo 
    "<html><head><title>DownloadsII</title></head><body>ERROR: File not found.</body></html>";
                                exit;
                            }
                            switch (
    $file_extension)
                            {
                                case 
    "asf": if (strstr("|".str_replace(" ","|",$vbulletin->options['ecextopen'])."|",$ext)){header("location: $dlfilename"); break;}$ctype="video/x-ms-asf"; break;
                                case 
    "avi": if (strstr("|".str_replace(" ","|",$vbulletin->options['ecextopen'])."|",$ext)){header("location: $dlfilename"); break;}$ctype="video/avi"; break;
                                case 
    "doc": if (strstr("|".str_replace(" ","|",$vbulletin->options['ecextopen'])."|",$ext)){header("location: $dlfilename"); break;}$ctype="application/msword"; break;
                                case 
    "exe": if (strstr("|".str_replace(" ","|",$vbulletin->options['ecextopen'])."|",$ext)){header("location: $dlfilename"); break;}$ctype="application/octet-stream"; break;
                                case 
    "gif": if (strstr("|".str_replace(" ","|",$vbulletin->options['ecextopen'])."|",$ext)){header("location: $dlfilename"); break;}$ctype="image/gif"; break;
                                case 
    "html": if (strstr("|".str_replace(" ","|",$vbulletin->options['ecextopen'])."|",$ext)){header("location: $dlfilename"); break;}$ctype="text/html"; break;
                                case 
    "htm": if (strstr("|".str_replace(" ","|",$vbulletin->options['ecextopen'])."|",$ext)){header("location: $dlfilename"); break;}$ctype="text/html"; break;
                                case 
    "jpeg": if (strstr("|".str_replace(" ","|",$vbulletin->options['ecextopen'])."|",$ext)){header("location: $dlfilename"); break;}$ctype="image/jpg"; break;
                                case 
    "jpg": if (strstr("|".str_replace(" ","|",$vbulletin->options['ecextopen'])."|",$ext)){header("location: $dlfilename"); break;}$ctype="image/jpg"; break;
                                case 
    "mp3": if (strstr("|".str_replace(" ","|",$vbulletin->options['ecextopen'])."|",$ext)){header("location: $dlfilename"); break;}$ctype="audio/mpeg3"; break;
                                case 
    "pdf": if (strstr("|".str_replace(" ","|",$vbulletin->options['ecextopen'])."|",$ext)){header("location: $dlfilename"); break;}$ctype="application/pdf"; break;
                                case 
    "ppt": if (strstr("|".str_replace(" ","|",$vbulletin->options['ecextopen'])."|",$ext)){header("location: $dlfilename"); break;}$ctype="application/vnd.ms-powerpoint"; break;
                                case 
    "png": if (strstr("|".str_replace(" ","|",$vbulletin->options['ecextopen'])."|",$ext)){header("location: $dlfilename"); break;}$ctype="image/png"; break;
                                case 
    "wav": if (strstr("|".str_replace(" ","|",$vbulletin->options['ecextopen'])."|",$ext)){header("location: $dlfilename"); break;}$ctype="audio/wav"; break;
                                case 
    "xls": if (strstr("|".str_replace(" ","|",$vbulletin->options['ecextopen'])."|",$ext)){header("location: $dlfilename"); break;}$ctype="application/vnd.ms-excel"; break;
                                case 
    "zip": if (strstr("|".str_replace(" ","|",$vbulletin->options['ecextopen'])."|",$ext)){header("location: $dlfilename"); break;}$ctype="application/zip"; break;
                                default: if (
    strstr("|".str_replace(" ","|",$vbulletin->options['ecextopen'])."|",$ext)){header("location: $dlfilename"); break;}$ctype="application/force-download";
                            }
                            
    header("Pragma: public"); // required
                            
    header("Expires: 0");
                            
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
                            
    header("Cache-Control: private",false); // required for certain browsers
                            
    header("(anti-spam-content-type:) $ctype; name=\"".basename($filename)."\";");
                            
    // change, added quotes to allow spaces in filenames, by Rajkumar Singh
                            
    header("Content-Disposition: attachment; filename=\"".basename($filename)."\";" );
                            
    header("Content-Transfer-Encoding: binary");
                            
    header("Content-Length: ".filesize($filename));
                            
    readfile("$filename");
                            exit();
                    
                    
    // end test download code
                
    }
                else
                {
                    
    header("Location: $file[url]");
                    exit();
                }
            }
        } 






    الملفات المرفقة الملفات المرفقة
    __________________
    السيف أصدق أنباء من الكتب





ضوابط المشاركة

  • لا تستطيع إضافة مواضيع جديدة
  • لا تستطيع الرد على المواضيع
  • لا تستطيع إرفاق ملفات
  • لا تستطيع تعديل مشاركاتك
  •  

أضف موقعك هنا| اخبار السيارات | حراج | شقق للايجار في الكويت | بيوت للبيع في الكويت | دليل الكويت العقاري | مقروء | شركة كشف تسربات المياه | شركة عزل اسطح بالرياض | عزل فوم بالرياض| عزل اسطح بالرياض | كشف تسربات المياة بالرياض | شركة عزل اسطح بالرياض