<script>
function HookDragNDrop(form)
{
var attachments = form.Form.ATTACHMENTS_DIV;
// Optional. Show the copy icon when dragging over. Seems to only work for chrome.
attachments.addEventListener('dragover', function(e) {
e.stopPropagation();
e.preventDefault();
e.dataTransfer.dropEffect = 'copy';
});
// Get file data on drop
attachments.addEventListener('drop', function(e) {
e.stopPropagation();
e.preventDefault();
var files = e.dataTransfer.files; // Array of all files
alert(files[0].name); //get the first file. Here you would have to find a way of uploading the files through javascript, reading HTML5 FileReader object.
});
}
</script>
2. کد زیر را در قسمت LoadCompleted قرار دهید :
HookDragNDrop(form);
آریا وردپرس