Home > Backend Development > PHP Tutorial > 帮看一上,在中文名和有空格的文件名的不能上载,另外重命名要是中文是乱码

帮看一上,在中文名和有空格的文件名的不能上载,另外重命名要是中文是乱码

WBOY
Release: 2016-06-13 12:54:38
Original
802 people have browsed it

帮看一下,在中文名和有空格的文件名的不能下载,另外重命名要是中文是乱码

本帖最后由 lfcyk 于 2013-01-22 22:41:49 编辑     /**
     * 下载远程文件类支持断点续传
     */
    class HttpDownload {
        private $m_url = "";
        private $m_urlpath = "";
        private $m_scheme = "http";
        private $m_host = "";
        private $m_port = "80";
        private $m_user = "";
        private $m_pass = "";
        private $m_path = "/";
        private $m_query = "";
        private $m_fp = "";
        private $m_error = "";
        private $m_httphead = "" ;
        private $m_html = "";
      
        /**
         * 初始化
         */
        public function PrivateInit($url){
            $urls = "";
            $urls = @parse_url($url);
            $this->m_url = $url;
            if(is_array($urls)) {
                $this->m_host = $urls["host"];
                if(!empty($urls["scheme"])) $this->m_scheme = $urls["scheme"];
                if(!empty($urls["user"])) $this->m_user = $urls["user"];
                if(!empty($urls["pass"])) $this->m_pass = $urls["pass"];
                if(!empty($urls["port"])) $this->m_port = $urls["port"];
                if(!empty($urls["path"])) $this->m_path = $urls["path"];
                $this->m_urlpath = $this->m_path;
                if(!empty($urls["query"])) {
                    $this->m_query = $urls["query"];
                    $this->m_urlpath .= "?".$this->m_query;
                }
            }
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template