It looks like you're new here. If you want to get involved, click one of these buttons!
<script type="text/javascript">
$(document).ready(function() {
$("#fileUpload3").fileUpload({
'uploader': 'uploadify/uploader.swf',
'cancelImg': 'uploadify/cancel.png',
'script': 'uploadify/upload.php',
'folder': './e',
'fileExt': '*.jpg;*.jpeg;*.gif;*.png',
'multi': true,
'auto': false,
'onError' : function(event,queueID,fileObj,errorObj){},
// alert(errorObj["type"]+" - "+errorObj["status"]+" - "+errorObj["text"]);
onComplete: function (evt, queueID, fileObj, response, data) {
alert("Successfully uploaded: ");
}
});
});
</script>$targetFolder = '../e'; // 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'); // File extensions
$fileParts = pathinfo($_FILES['Filedata']['name']);
if (in_array($fileParts['extension'],$fileTypes)) {
move_uploaded_file($tempFile,$targetFile);
echo '1';
} else {
echo 'Invalid file type.';
}
}