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

  • SEARCH
  • Home
  • 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 8137257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:03:19+00:00 2026-06-06T11:03:19+00:00

I ran a quick google and SO search and found similar questions but none

  • 0

I ran a quick google and SO search and found similar questions but none were well formed and most were old and looked abandoned (no answers, and no comments for a while). So here goes…

I want to be able to collect the url (only the url) of an image being dropped onto my site from another website.. (i.e. I have two chrome windows open. Window A has my application in it. Window B has imgur in it. I open an image click and drag it to my window and let go. Now I need to know the url of the image dropped on my page).

Here is the code I was working with for local files.

$(document).on('drop', function(e) {
    var data = e.dataTransfer || e.originalEvent.dataTransfer;
    console.log(data); // data.files is empty
    e.preventDefault();
    return false;
});​

Again I do not want to upload anything.. i’m not trying to do anything fancy… I just need to know the location of the image being dropped on the page from another website.

  • 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-06-06T11:03:21+00:00Added an answer on June 6, 2026 at 11:03 am

    Try this: http://jsfiddle.net/2Jet2/70/

    $(document).on('dragover', function(e) {
         e.preventDefault();
    });
    $(document).on('drop', function(e) {
        e.preventDefault();
        e.originalEvent.dataTransfer.items[0].getAsString(function(url){
            alert(url);
        });
    });​
    

    I get "http://static3.flattr.net/thing/image/9/4/5/5/0/huge.png?1326712342" When I dragged that image from another browser window.

    .getAsString takes a callback which gets the url as argument once it’s called

    Doesn’t work on firefox

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

Sidebar

Related Questions

Tried to throw a quick example together this morning but I ran into a
I ran into a little problem today when I was creating a really quick
Quick question about Ruby forking - I ran across a bit of forking code
I have two Google App Engine Models. I ran my cron's a few times
I have a quick question about a glitch in this coding. When I ran
I downloaded and ran setup, and it seemed to completed normally, but after it
I did a quick Google on the title and got pummelled with all this
Quick question about something I've ran into alot recently: So many times I'm looking
I just ran into what I think is a very strange issue, but it's
So, I am very confused over a quick test that I just ran. I

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.