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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:47:34+00:00 2026-06-12T02:47:34+00:00

I have a data uri in memory that I would like the user to

  • 0

I have a data uri in memory that I would like the user to download.

This fiddle works in chrome but not FF: http://jsfiddle.net/6W2TY/

When you click run it will download the tiny image in chrome and do nothing in FF. Can anyone help me understand why it doesn’t work in FF and what I need to do to make it work?

Thanks!

  • 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-12T02:47:36+00:00Added an answer on June 12, 2026 at 2:47 am

    You are using the new (html5) download attribute. As far as I know this is only supported in Chrome and not (yet) in Firefox.

    Update 3-2018
    This feature is now supported in almost all major browsers (No IE support).

    Alternative: Using location.href

    Another way to force a download is to redirect the user to the image like this:

    // generate the image
    var img = ""
    
    // then call a function maybe onClick or something
    downloadImage(img);
    
    function downloadImage(data) {
        location.href = "data:application/octet-stream;base64," + data;
    }
    

    Or the short version

    location.href = "data:application/octet-stream;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAYAAAAmL5yKAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAABWSURBVDhPY0xISPh//0UOA7mAiVyNMH2jBjAwkBQGjD9KGBTEJ6OEO0kG2NvbMwCjnXwDsEU5SS5ANuDhjRCGJbPFSQsDdBfIyMhQZgDIQLK9QLWkDABPsQw5I+5qmAAAAABJRU5ErkJggg=="
    

    Alternative: Server Side

    As an alternative, if you are processing the image serverside you can force a download by setting the content-disposition header.

    PHP Example

    header('Content-Disposition: attachment; filename="image.png"');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have cool uri in format page.com/par1/par2/par3 But on this page is form, that
I have code that generates a data-driven SVG graph and I'd like to display
I have a piece of code that looks like this: downloadsByExtensionCount = defaultdict(int) downloadsByExtensionList
My javascript script has an image as URI data, like this: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO 9TXL0Y4OHwAAAABJRU5ErkJggg==
This sounds like a weird title and probably not stated too well. But here's
I have 'data.xlsx' file with cells of numbers and letters. when I run this
I have data like the following: var data = [{ id: 1, date: new
I have data-segment attribute in my body tag that is changed by a slider.
I have data from two different sources that I need to combine. Some data
I have a data URI I am getting from javascript and trying to save

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.