Can I open the BT seed in PHP and download it to the server side?

Source: Internet
Author: User
Tags fread vars
I want to upload the BT file to the server and open the BT seed file with PHP, and use PHP to download to the server side, one is to save hard disk space, there is fast!

Who knows? Please post the Code


Reply to discussion (solution)

Large files are not allowed, small files can be.
Time is long, php execution script will time out, you must use server-side command download to download large files

Http://www.162cm.com/archives/287.html

     Output read-in array.    */Print_r ($DATA); /** @function READBT read into BT file, @param $fp file pointer @param $nowtype: Of course, the metadata type @return array is an array that holds the current set of metadata */Functio        N READBT ($fp, $nowtype = "DICT") {$nowindex = "";            while (!feof ($fp)) {$char = (string) fread ($fp, 1);                 /** actually carefully study, perhaps here a few case placement, such as which in front of which in the post, on the speed is influential, but we do not care about it/switch ($char) { Case ' 1 ': Case ' 2 ': Case ' 3 ': Case ' 4 ': Case ' 5 ': Case ' 6 ': Case ' 7 ': Case ' 8 ': Case ' 9 ': CAs                    E "0": {$nowindex. = $char;                Break                    } case ":": {$nowtype = "STRING";                     $string =fread ($fp, Intval ($nowindex));                    $VARS []= $string;                    $nowindex = ""; $Nowtype= "";                Break                    } case "I": {$nowtype = "number";                 Break The case "E": {/** E is an end-of-code flag, depends on what encoding is currently present.                    If it is number, a system array that is currently read in is saved directly, and if it is a list or dictionary (dictionary), the array is returned.                             */switch ($nowtype) {case "number":                            $VARS []=intval ($nowindex);                            $nowindex = "";                        Break                            Case "LIST": return $VARS;                        Break                            Case "DICT": return $VARS;                    Break                } break; /** When you start a list or dictionary, I use recursion in order to show the table of contents relationships more clearly in the resulting array.                You can also not use recursion. */CAsE "L": {$nowtype = "LIST";                    $VARS []=READBT ($FP, $nowtype);                    Break                    } case "D": {$nowtype = "DICT";                    $VARS []=READBT ($FP, $nowtype);                Break    }}} return $VARS;  } fclose ($FP); ?>

+1
Large files are not allowed, small files can be.
Time is long, php execution script will time out, you must use server-side command download to download large files

Http://www.162cm.com/archives/287.html

     Output read-in array.    */Print_r ($DATA); /** @function READBT read into BT file, @param $fp file pointer @param $nowtype: Of course, the metadata type @return array is an array that holds the current set of metadata */Functio        N READBT ($fp, $nowtype = "DICT") {$nowindex = "";            while (!feof ($fp)) {$char = (string) fread ($fp, 1);                 /** actually carefully study, perhaps here a few case placement, such as which in front of which in the post, on the speed is influential, but we do not care about it/switch ($char) { Case ' 1 ': Case ' 2 ': Case ' 3 ': Case ' 4 ': Case ' 5 ': Case ' 6 ': Case ' 7 ': Case ' 8 ': Case ' 9 ': CAs                    E "0": {$nowindex. = $char;                Break                    } case ":": {$nowtype = "STRING";                     $string =fread ($fp, Intval ($nowindex));                    $VARS []= $string;                    $nowindex = ""; $Nowtype= "";                Break                    } case "I": {$nowtype = "number";                 Break The case "E": {/** E is an end-of-code flag, depends on what encoding is currently present.                    If it is number, a system array that is currently read in is saved directly, and if it is a list or dictionary (dictionary), the array is returned.                             */switch ($nowtype) {case "number":                            $VARS []=intval ($nowindex);                            $nowindex = "";                        Break                            Case "LIST": return $VARS;                        Break                            Case "DICT": return $VARS;                    Break                } break; /** When you start a list or dictionary, I use recursion in order to show the table of contents relationships more clearly in the resulting array.                You can also not use recursion. */CAsE "L": {$nowtype = "LIST";                    $VARS []=READBT ($FP, $nowtype);                    Break                    } case "D": {$nowtype = "DICT";                    $VARS []=READBT ($FP, $nowtype);                Break    }}} return $VARS;  } fclose ($FP); ?>
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.