2015-04-07 14:44
浏览 214

move_uploaded_file()无法移动文件导致我的权限? [关闭]

I have a problem with PHP.

Basically, I have a script that take a file from a form, and I want to upload it on the server.

What i do is :

function uploadXLS($file){
$target_dir = "../uploads/";
$target_file = $target_dir . $file["name"];

if(checkFile($file) == False) return null;
echo "checked";

$result = move_uploaded_file($file["tmp_name"], $target_file);
echo "move";
if($result != 1)return null;
echo "done<br>"; 

This works perfectly in localhost with Wamp, but on the server that I use (which is not mine) I the move_uploaded_file don't work.

I don't think there is a password or something like that, it should be an "open" server. What can I do to try to fix this problem?

图片转代码服务由CSDN问答提供 功能建议


基本上我有一个脚本 从表单中获取文件,我想将其上传到服务器上。


  function uploadXLS  ($ file){
 $ target_dir =“../uploads/";
$target_file = $ target_dir。  $ file [“name”]; 
if(checkFile($ file)== False)返回null; 
 $ result = move_uploaded_file($ file [“tmp_name”],$ target_file  ); 
if($ result!= 1)返回null; 
echo“done&lt; br&gt;”;  

这在带有Wamp的localhost中完美有效,但在我使用的服务器上(不是我的)我是 move_uploaded_file 不工作。

我认为没有密码或类似的东西,它应该是一个“开放”的服务器。 我该怎么做才能解决这个问题?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题