I have a problem with the ui widget from plupload, my javascript is:
$("#uploader").plupload({
// General settings
runtimes : 'html5,flash,silverlight,html4',
url : "upload.php",
// Maximum file size
max_file_size : '20mb',
// Resize images on clientside if we can
resize : {
width : 200,
height : 200,
quality : 90,
crop: true // crop to exact dimensions
},
prevent_duplicates : true,
// Specify what files to browse for
filters : [
{title : "Document files", extensions : "xls,xlsx,doc,docx,pdf,ppt,pptx"},
{title : "Image files", extensions : "bmp,jpeg,jpg,gif,png"},
{title : "Zip files", extensions : "zip,rar"}
],
multipart_params : {
"autor" : "<?=$id_user?>",
"fecha" : "<?=$fechas?>",
"id_recepcion" : "<?=$id_recepcion?>",
"id_decomiso" : "<?=$id_decomiso?>"
},
// Rename files by clicking on their titles
rename: true,
// Sort files
sortable: true,
// Enable ability to drag'n'drop files onto the widget (currently only HTML5 supports that)
dragdrop: true,
// Views to activate
views: {
list: true,
thumbs: true, // Show thumbs
active: 'thumbs'
},
// Flash settings
flash_swf_url : 'js/plupload/js/Moxie.swf',
// Silverlight settings
silverlight_xap_url : 'js/plupload/js/Moxie.xap'
});
and upload.php is:
if (empty($_FILES) || $_FILES["file"]["error"]) {
die('{"OK": 0}');
}
$fileName = $_FILES["file"]["name"];
move_uploaded_file($_FILES["file"]["tmp_name"], "upload/documentos/$fileName");
for some reason the documents are not saved in the destination folder, which has read / write permissions.