Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6894051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:44:04+00:00 2026-05-27T06:44:04+00:00

I have setup an HTML5 drag and drop upload into my site. The problem

  • 0

I have setup an HTML5 drag and drop upload into my site. The problem that I have is when a user is uploading a large file, they must wait for the upload to finish before navigating and using the rest of the site.

So, what I’d like to do is allow the user to drag files to the main site and then have it automatically open a new window and start the upload there so they can still use the rest of the site while the upload is happening. Anyone have and advice on how to accomplish this or if it can even be done?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:44:04+00:00Added an answer on May 27, 2026 at 6:44 am

    You should be able to open the new window when the drop event occurs. Below is a full example.

    First, we have a file upload region and events that handle the drag and drop:

    <html>
    <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    </head>
    <body>
    <div id="fileUpload" style="height:200; width:200; border:1px solid #ddd;"><span id="lbl">Drag and drop file here...</span></div>
    
    <script>
    $(function() {
        $('#fileUpload').get(0).addEventListener("drop", upload, false);        
        $('#fileUpload').get(0).addEventListener("dragenter", noopHandler, false);
        $('#fileUpload').get(0).addEventListener("dragexit", noopHandler, false);
        $('#fileUpload').get(0).addEventListener("dragover", noopHandler, false);
    
        function noopHandler(e) {
            e.stopPropagation();
            e.preventDefault();
        }
    
        function upload(e) {
           e.stopPropagation();
           e.preventDefault();
    
           fileList = e.dataTransfer.files;
           var fileCount = fileList.length;
    
           // Only call the handler if 1 or more files was dropped.
           if (fileCount > 0) {
               window.open("upload.html");
           }
        }
    });
    </script>
    </body>
    </html>
    

    In the pop-up window (upload.html), we get the files from the parent window and begin the upload:

    <html>
    <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    </head>
    <body>
    <script>
        $(function() {
            var fileList = window.opener.fileList;
    
            var reader = new FileReader();     
            reader.onloadend = function(e) { alert("Uploaded"); }
    
            for (file in fileList) {
                // Upload
                reader.readAsDataURL(fileList[file]);
            }
        });
    </script>
    </body>
    </html>
    

    Give this a try and hopefully it helps solve the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to setup HTML5 drag and drop using dataTransfer.getData (http://html5demos.com/drag-anything) which reads any
I have a script that makes me able to drag some content in a
I'm using the HTML5 Web Database API and I have a function that checks
I have a set of headers and sections in an HTML5 file which uses
I have successfully setup an HTML form in PHP File #1, and it is
I'm uploading multiple files via XmlHTTPRequest and HTML5. I have the uploading working fine,
I have a setup with a traditional form that's checked with jQuery Tools validator
i have setup tinymce in a webpage for users to generate html data that
I have setup a cronjob in etc/crontab file as shown below */1 * *
I have setup a process in my User model to send a bunch of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.