php上传flv,使用PHP上传.WMV和.FLV
我想使用Uploadify和PHP上傳.wmv和.flv文件。但是,我似乎無法做到。
這是我的代碼:
$(function() {
$("#file_upload").uploadify({
'swf' : 'uploadify/uploadify.swf',
'uploader' : 'uploadify/uploadify.php',
'uploadLimit' : 1,
'folder' : 'uploads',
'method' : 'post',
'auto' : true,
'multi' : true,
'fileExt' : '*.jpg; *.gif; *.png; *.jpeg; *.wmv; *.flv',
'onUploadSuccess' : function(file, data, response) {
alert('The file was saved to: ' + file);
}
});
});Uplodify.php
$targetFolder = '/uploads'; // Relative to the root
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $targetFolder;
$targetFile = rtrim($targetPath,'/') . '/' . $_FILES['Filedata']['name'];
// Validate the file type
$fileTypes = array('jpg','jpeg','gif','png','wmv'); // File extensions
$fileParts = pathinfo($_FILES['Filedata']['name']);
move_uploaded_file($tempFile,$targetFile);
}任何想法,我做錯(cuò)了什么?
總結(jié)
以上是生活随笔為你收集整理的php上传flv,使用PHP上传.WMV和.FLV的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: VBA Excel 自定义函数不能调用成
- 下一篇: 动态规划算法php,php算法学习之动态