Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

139
Views
How to add a file to javascript event.dataTransfer on the fly?

Is there a way how i can set the file (html file) to javascript event.dataTransfer on the fly?

Lets say i am dragging the div element but underneath i want to drop html file.

The drop zone will be email client, ms word or some other text editor (not a web page).

I see its possible to drag images, text and html from browser, but i cant find out if its possible with files.

I create file like this:

const f = new File(['<html><body><p>start</p></body></html>'], 'filename.html', {
    type: 'text/html',
    lastModified: new Date().getTime(),
});
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!