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 6886931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:49:17+00:00 2026-05-27T05:49:17+00:00

Interested in building my own drag’n’drop file uploader using JQuery/AJAX/PHP. Basically I want a

  • 0

Interested in building my own drag’n’drop file uploader using JQuery/AJAX/PHP.

Basically I want a file-uploader that users of my site can just drag the file from their computer into a div I created, and it will then upload the file for them to the selected destination.

I would like to build this from scratch, and not use any plugins so that I can better manipulate the restrictions (file types, size, destination folders, etc.)

Have scoured google with no luck, only plugins. Can anyway steer me in the right direction?

UPDATE
Ok, so I figured out how to do what I want. Just set the file input field opacity to 1 so it is hidden, and you can still drag a file into that general area and if you hit the text field it will catch it. HOWEVER, I would like to know how to increase the height/width on the file input field (tried basic css on the file, but it only increases the ‘browse’ button size and not the actual field where you can drop the file into. Any ideas how to do this?
I basically want a big square div that says ‘Drop file here’. So I need to resize the input field.

  • 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-27T05:49:18+00:00Added an answer on May 27, 2026 at 5:49 am

    You can use the HTML5 dragenter and dragleave events to create a dropzone.
    Then by placing a file input inside the dropzone, and hiding it with CSS, you can upload the file when the change event for the input fires, like this

    var dropzone = $("#dropzone"),
        input    = dropzone.find('input');
    
    dropzone.on({
        dragenter : dragin,
        dragleave : dragout
    });
    
    input.on('change', drop);
    
    function dragin(e) { //function for drag into element, just turns the bix X white
        $(dropzone).addClass('hover');
    }
    
    function dragout(e) { //function for dragging out of element                         
        $(dropzone).removeClass('hover');
    }
    
    function drop(e) {
        var file = this.files[0];
        $('#dropzone').removeClass('hover').addClass('dropped').find('img').remove();
    
        // upload file here
    }
    

    FIDDLE

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

Sidebar

Related Questions

I am interested in building a parser for my own enjoyment using PHP. What
I am interested in building a stack overflow style tags input using jquery autocomplete.
I am interested in building my own php framework for my personal use to
I'm interested in building a PC for a car that will boot off of
So basically I would like somehow that given an audio file as input (most
I am interested in building web applications using Ruby on Rails. I surfed the
I'm interested in building something that requires a table sorting plugin. Best way to
I'm interested in building a thick client application for my existing web services that
I'm interested in using a statistical programming language within a web site I'm building
I'm interested in building a Texas Hold 'Em AI engine in Java. This is

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.