开发者

Unable to Upload file with filename with different extention in php

开发者 https://www.devze.com 2022-12-10 04:40 出处:网络
Unable to Upload file with filename with different extention in php echo basename( $_FILES[\'uploadedfile\'][\'name\']);

Unable to Upload file with filename with different extention in php

echo basename( $_FILES['uploadedfile']['name']);
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']); 
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
 //  header("Location: EHP_Configuration.html");
开发者_如何学Go } else{
  //   header("Location: EHP_Configuration.html");
        echo "Notdone";
 }

i have verified that on Echo it show proper filename

But move_upload give me "Notdone"

Regards


Have you got error_reporting on? If so check to see if a warning is thrown, if there is no warning and you're just getting FALSE retruned then PHP doesn't think the file is a valid uploaded file (done via PHPs HTTP POST) if you are getting a warning as well as a return value of FALSE this should give some indication as to what the problem with moving the file is.


May be you have missed slash here:

$target_path . '/' . basename( $_FILES['uploadedfile']['name']); 

I miss it all the time :)

0

精彩评论

暂无评论...
验证码 换一张
取 消