Help to see, in the Chinese name and the file name with a space can not download, in addition to rename if the Chinese is garbled
This post was last edited by Lfcyk on 2013-01-22 22:41:49
/**
* Download remote file class support breakpoint continuation
*/
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 = "";
/**
* Initialization
*/
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;
}
}