Em navegadores suportados, um arquivo pode ser selecionado arrastando e soltando do sistema de arquivos. O próprio componente FileUpload é a zona para soltar.
$render=explode(" ",$_POST[$quot;partial_render$quot;]);
if($_POST[$quot;source$quot;]==$quot;arquivos$quot;){
$resposta=$quot;
<span id="alerta" class="ui-growl-pl" data-widget="widget_alerta" data-summary="data-summary" data-detail="data-detail" data-severity="all,error" data-redisplay="true"></span>
<script id="messages_s" type="text/javascript">
DinarteCoelho.cw("Growl", "widget_alerta", {
id: "alerta",
sticky: false,
life: 6000,
escape: true,
keepAlive: false,
msgs: [{
summary:"Sucesso!",
detail:"$quot;.$_FILES[$quot;arquivos$quot;][$quot;name$quot;].$quot; recebido.",
severity:"info",
severityText:"Information"
}]
});
</script>
$quot;;
}
if($_POST[$quot;source$quot;]==$quot;arquivosArea$quot;){
$render[0]=$quot;0$quot;;
$resposta=$quot;$quot;;
$eval=$quot;DC(\$quot;textarea\$quot;).jq.val(DC(\$quot;textarea\$quot;).jq.val() + \$quot;\n\n$quot;.$_FILES[$quot;arquivosArea$quot;][$quot;name$quot;].$quot; recebido.\$quot;);$quot;;
}
dc.cw("Growl", "widget_alerta", {
id: "alerta"
, sticky: false
, life: 6000
, escape: true
, keepAlive: false
, msgs: []
});
dc.cw("FileUpload", "widget_arquivos", {
id: "arquivos"
, resumeContextPath: "\/sistema\/file\/resume\/"
, mode: "advanced"
, update: "alerta"
, maxFileSize: 100000.0
, allowTypes: /(\.|\/)(gif|jpe?g|png)$/
});
dc.cw("InputTextarea", "textarea", {
id: "customDropZone"
, autoResize: true
});
dc.cw("FileUpload", "uploadDnd", {
id: "arquivosArea"
, resumeContextPath: "\/sistema\/file\/resume\/"
, dropZone: "customDropZone"
, mode: "advanced"
, auto: true
, maxFileSize: 100000.0
, allowTypes: /(\.|\/)(gif|jpe?g|png)$/
});