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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:23:49+00:00 2026-05-31T08:23:49+00:00

I have an offline html file that generates and saves a CSV by setting

  • 0

I have an offline html file that generates and saves a CSV by setting window.location to

data:text/csv;base64,Intfa2V5fSIsInt...

However, in Safari this just brings up the CSV in the browser.

Setting the url to:

data:application/csv;base64,Intfa2V5fSIsInt...

forces Safari to download the file – but it gets a generic file name of just ‘Unknown-3’. Is there a way to specify the file name?

  • 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-31T08:23:50+00:00Added an answer on May 31, 2026 at 8:23 am

    First, a warning:application/csv isn’t a valid MIME type, so the fact that it “works” for you in this case is purely an implementation quirk that could very well change in the future. (For example, Safari displays application/octet-stream, which I’d expect to download.)

    HTML5 does have a new <a download="file.name"> attribute. This forces the browser to download the file to disk; it uses the attribute’s value as the default file name. It does work in conjunction with a data URI or a blob URI. (Demo)

    However, it is currently only supported by Chrome (14+). Safari 5.1 ignores the attribute.


    A possible alternative is to use the Filesystem API, but that gives you a sandboxed folder to work with. You can’t—for example—save a file directly to the user’s Documents folder. Instead, you can write a file to the sandbox and then redirect to file on the new filesystem schema:

    location.assign('filesystem:http://example.com/temporary/somefile.csv');
    

    This should invoke the UA’s download mechanism (with the right filename!), but I haven’t tested this, so it is possible Safari will just display the file anyway.

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

Sidebar

Related Questions

I have an Android application that generates some HTML which is rendered locally, in
does anybody have any experience writing up a offline data storage & access app
I need to be able to run HTML forms offline. I mean they have
Does the HTML 5 application (offline) cache have any benefit for online/connected apps? My
I have a function that redirects to a countdown while our system is offline,
I have the HTML: <div> <span class=label><a href=/index/1>Bookmix Offline</a></span> <span class=button><a href=/settings/>Settings</a></span> <span class=button><a
I have piece of offline html like so: <img src=../img/button.png/> and when I try
When Connected: I have a simple HTML page with some image elements that reference
I will have to create an offline app from a received html5 file (sort
I have an HTML5 iPad app that works offline. The app essentially consists 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.