您好我正在尝试将文件上传到网络服务器但是卷曲似乎在Ubuntu中无法正常工作,因为我已经在基于Windows 8的计算机上使用了相同的代码而我没有遇到过任何问题问题。当我在firefox和谷歌浏览器中尝试我的代码但结果相同时,这就是我得到的错误:
EDITED: 我终于搞定了!原来问题出在我的文件许可中.. 这是我的代码(**已编辑):
<?php
$id = array(
"0" => "62",
);
for($x = 0; $x < sizeof($id); $x++){
print_r($id[$x]);
//check account
$xml_str="<request type='UPLOAD_CONTENT' username='user' password='".md5('pass')."' identification=''>
<content contenttype='NORMAL' caption='sunny test' md5='".md5_file('sunnys.package')."' terminalidlist='".$id[$x]."' downloaddatetype='ANYDATE' downloadtimetype='ANYTIME'/>
</request>";
$url = "http://localhost:8080/CommitLoginAction.do" . urlencode($xml_str);
$response = `curl -F file=@sunnys.package $url`;
echo($url);
$data = simplexml_load_string($response);
print_r($response);
}
?>
同样,我已经调试了这个,而且我只有卷曲问题。并且我已经检查过curl已经在我的服务器中安装并启用了。如果你们中的任何人都可以帮助我,我会非常感激。谢谢!!