Olá pessoal... seguinte eu entendo oque o codigo faz por um todo.. mas queria entender oque ele esta fasendo em kda linha para que possa modificar corretamento o arquivo.. Este é o arquivo check.php $fileArray = array();foreach ($_POST as $key => $value) {
if ($key != 'folder') {
if (file_exists($_SERVER['DOCUMENT_ROOT'] . $_POST['folder'] . '/' . $value)) {
$fileArray[$key] = $value;
}
}
}
echo json_encode($fileArray);
este é o arquivo uploadfy.php
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';
$targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
move_uploaded_file($tempFile,$targetFile);
echo "1";
}
e este é o index.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Uploadify Example Script</title>
<link href="/example/css/default.css" rel="stylesheet" type="text/css" />
<link href="/example/css/uploadify.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/example/scripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="/example/scripts/swfobject.js"></script>
<script type="text/javascript" src="/example/scripts/jquery.uploadify.v2.1.0.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#uploadify").uploadify({
'uploader' : 'scripts/uploadify.swf',
'script' : 'scripts/uploadify.php',
'cancelImg' : 'cancel.png',
'folder' : 'fotos',
'queueID' : 'fileQueue',
'auto' : true,
'multi' : true
});
});
</script>
</head>
<body>
<div id="fileQueue"></div>
<input type="file" name="uploadify" id="uploadify" />
<p><a href="java script:jQuery('#uploadify').uploadifyClearQueue()">Cancel All Uploads</a></p>
</body>
</html> Contudo este é um Jquery que faz upload de multiploas arquivos, eu estou tentando modifica-lo para que eu possa tratar imagens, como tamanho e qualidade.. flws desde já agradeço.