开发者

PHP WMV file upload failed

I'm doing a test with PHP file upload but seems like my script isn't allowing me to upload WMV.

Here is the PHP script that开发者_StackOverflow社区 I have

<?php
$target_path = "uploads/";

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

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
    echo "The file ".  basename( $_FILES['uploadedfile']['name']).
    " has been uploaded";
} else{
    echo "There was an error uploading the file, please try again!";
}
?>

Here is the HTML script

<form enctype="multipart/form-data" action="uploader.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000000" />
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form>

When I try other formats like jpg, mov it works just fine.

Is there a special setup I need to do for wmv?

I'm using XAMMP on mac

Thanks,

Tee


Check your php.ini that your POST max size and maximum file upload size are at least as large as the file size of your .wmv file (your HTML instruction is client-side only). The type of file itself should make no difference. (Restart your web server after changing your php.ini file and use <?php phpinfo(); > to find out where your php.ini file is being loaded from.)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜