0

I've a little issue. I want to upload files either with an 'normal' input like in the screenshot but I want to have also the possebility to upload file via Drag&Drop(HTML5).Screenshot

I found some examples but I can't adopt it like an .

Here're the snippets from my code:

 if (uploadFile.HasFile)
            {
                for (int i = 0; i < uploadFile.PostedFiles.Count; i++)
                {
                    HttpPostedFile userPostedFile = uploadFile.PostedFiles[i];
                    Int32 fileid = ticketcreation.insertFile(tmid, userPostedFile.FileName, userPostedFile.ContentType);
                    String fileExtension = Path.GetExtension(userPostedFile.FileName).ToLower();
                    String path = Server.MapPath("~/data/");
                    userPostedFile.SaveAs(path + tid + "-" +fileid.ToString() + fileExtension); // eg ~/data/1594-20.xlsx
                }
            }

Is there any possebility to handle the Drag&Drop zone like an input element ? Btw it would be realy nice if the drag and dropzone is clickable and the 'default' file selection window appears. Does someone has an idea or a code snippet for me? I'm using IE11 and Firefox 20+.

Thanks :) BR CortexA8

CortexA8
  • 33
  • 6
  • Possible duplicate of [drag drop files into standard html file input](http://stackoverflow.com/questions/8006715/drag-drop-files-into-standard-html-file-input) – Aymeric Mar 18 '16 at 09:22
  • No :( In my case I need the support for the IE11 (Win7/Win10). Any other suggestions? – CortexA8 Apr 12 '16 at 09:59

0 Answers0