drag drop files into standard html file input

The following works in Chrome and FF, but i’ve yet to find a solution that covers IE10+ as well: // dragover and dragenter events need to have ‘preventDefault’ called // in order for the ‘drop’ event to register. // See: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Drag_operations#droptargets dropContainer.ondragover = dropContainer.ondragenter = function(evt) { evt.preventDefault(); }; dropContainer.ondrop = function(evt) { // pretty … Read more

How do I drag and drop files into an application?

Some sample code: public partial class Form1 : Form { public Form1() { InitializeComponent(); this.AllowDrop = true; this.DragEnter += new DragEventHandler(Form1_DragEnter); this.DragDrop += new DragEventHandler(Form1_DragDrop); } void Form1_DragEnter(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) e.Effect = DragDropEffects.Copy; } void Form1_DragDrop(object sender, DragEventArgs e) { string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); foreach (string file in files) Console.WriteLine(file); } … Read more

HTML5 dragleave fired when hovering a child element

You just need to keep a reference counter, increment it when you get a dragenter, decrement when you get a dragleave. When the counter is at 0 – remove the class. var counter = 0; $(‘#drop’).bind({ dragenter: function(ev) { ev.preventDefault(); // needed for IE counter++; $(this).addClass(‘red’); }, dragleave: function() { counter–; if (counter === 0) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)