public
function
Action_Upload(){
$this
->path_config();
exit
();
$furl
=
"@d:\develop\JMFrameworkWithDemo.rar"
;
$url
=
"http://localhost/DemoIndex/curl_pos/"
;
$this
->upload_file_to_cdn(
$furl
,
$url
);
}
public
function
upload_file_to_cdn(
$furl
,
$url
){
$ch
= curl_init();
$post_data
=
array
(
"upload"
=>
$furl
);
curl_setopt(
$ch
, CURLOPT_URL,
$url
);
curl_setopt(
$ch
, CURLOPT_RETURNTRANSFER, 0);
curl_setopt(
$ch
, CURLOPT_HEADER, 0);
curl_setopt(
$ch
, CURLOPT_REFERER,
"http://www.baidu.com"
);
curl_setopt(
$ch
, CURLOPT_POST, 1);
curl_setopt(
$ch
, CURLOPT_TIMEOUT, 100);
curl_setopt(
$ch
, CURLOPT_POSTFIELDS,
$post_data
);
curl_exec(
$ch
);
if
(curl_exec(
$ch
) === FALSE)
{
echo
"<br/>"
,
" cUrl Error:"
.curl_error(
$ch
);
}
curl_close(
$ch
);
echo
"aaa45"
;
}
function
action_curl_pos(){
var_dump(
$_FILES
);
$aa
= move_uploaded_file(
$_FILES
[
"upload"
][
"tmp_name"
],
"/wamp/tools/1.rar"
);
if
(
$aa
){
echo
"11"
;
}
}