function fput($remotefile, $fp) {
        if($this->_can_restore and $rest!=0) fseek($fp, $rest);
        $pi=pathinfo($remotefile);
        if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII;
        else $mode=FTP_BINARY;