It looks like you're new here. If you want to get involved, click one of these buttons!
<html>
<head>
<title>Uploader</title>
<script type="text/javascript" src="js/uploadify/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/uploadify/swfobject.js"></script>
<script type="text/javascript" src="js/uploadify/jquery.uploadify.v2.1.4.min.js"></script>
<script type="text/javascript">
<!--
jQuery(document).ready(function() {
$('#file_upload').uploadify({
'uploader' : 'js/uploadify/uploadify.swf',
'script' : 'js/uploadify/uploadify.php',
'multi' : true,
'height' : '50',
'width' : '200',
'sizeLimit' : '8388608',
'simUploadLimit' : '1',
'buttonImg' : 'img/browse.png',
'cancelImg' : 'js/uploadify/cancel.png',
'expressInstall' : 'js/uploadify/expressInstall.swf',
'fileDesc' : 'Archive files (.zip)',
'fileExt' : '*.zip',
'queueSizeLimit' : '5',
'removeCompleted' : false,
'folder' : 'temp',
onProgress: function() {
$('#loader').show();
},
onAllComplete: function() {
$('#loader').hide();
},
});
$('ul li:odd').addClass('odd');
});
-->
</script>
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
</head>
<$php
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . 'files/';
// I would like to upload in "files", not "temp" as the folder setting suggests
$targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
// $fileTypes = str_replace('*.','',$_REQUEST['fileext']);
// $fileTypes = str_replace(';','|',$fileTypes);
// $typesArray = split('\|',$fileTypes);
// $fileParts = pathinfo($_FILES['Filedata']['name']);
// if (in_array($fileParts['extension'],$typesArray)) {
// Uncomment the following line if you want to make the directory if it doesn't exist
// mkdir(str_replace('//','/',$targetPath), 0755, true);
move_uploaded_file($tempFile,$targetFile);
echo str_replace($_SERVER['DOCUMENT_ROOT'],'',$targetFile);
// } else {
// echo 'Invalid file type.';
// }
}
?>$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';;