It looks like you're new here. If you want to get involved, click one of these buttons!
<link href="/uploadify/uploadify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/uploadify/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="/uploadify/swfobject.js"></script>
<script type="text/javascript" src="/uploadify/jquery.uploadify.v2.1.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#someID').uploadify({
'uploader' : '/uploadify/uploadify.swf',
'script' : '/uploadify/uploadify.php',
'cancelImg' : '/uploadify/cancel.png',
'folder' : '/media',
'scriptData': {'id':'<?php echo $UserId;?>','filenumber':'<?php echo $filename_new;?>'},
'onAllComplete' : function(event,data) {
document.getElementByID('AddMedia').submit();
}
});
});
</script>
<form id="AddMedia" action="/page/media/" method="POST">
<input id="someID" name="someName" type="file" />
<input type="hidden" name="stap" value="2">
<input onclick="$('#someID').uploadifyUpload()" type="image" src="/images/buttons/bevestig.png" alt="Bevestig" value="Submit" />
if (!empty($_FILES))
{
$posted_userid = htmlspecialchars($_POST['id']);
$filenumber = htmlspecialchars($_POST['filenumber']);
if(is_numeric($posted_userid))
{
if(is_numeric($filenumber))
{
$filename_new = $posted_userid."_".$filenumber;
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';
$targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
//$targetFile = str_replace('//','/',$targetPath) . $filename_new.".".end(explode(".",$_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.';
//}
}
else
{
}
}
else
{
}
}
brakzijn said: The CHMDR are set to 0755, so the permissions are set correctly.