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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:21:24+00:00 2026-06-14T09:21:24+00:00

I want to export the exist data into csv file. I try to use

  • 0

I want to export the exist data into csv file. I try to use this code:

var uriContent = "data:text/csv;charset=utf-8," + encodeURIComponent(data);
var myWindow = window.open(uriContent);
myWindow.focus();

it works but I can design filename. I can only get the dialog with name like “MVeAnkW8.csv.part” which I don’t know where the name come from.

How can I assign filename in the first dialog? Thanks in advance.

update:

I am now using rails. Actually I have a method in server side names export_to_csv. In end of this method, I use code like that:

  send_data(csv_string,
  :type => 'text/csv; charset=utf-8;',
  :filename => "myfile.csv")

It works and I can specify the file name.
For now, I want to use ajax to get more csv files(that is the reason why I want to use javascript, because a normal http request can only get one file to be downloaded).

I use js code like that:

$.post("export_to_csv",
 function(data) {
 var uriContent = "data:text/csv;charset=utf-8," + encodeURIComponent(data);
     var myWindow = window.open(uriContent);
     myWindow.focus();});     

It get the data from server side and I try to transfer it into csv. I can get a file but can’t 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-06-14T09:21:26+00:00Added an answer on June 14, 2026 at 9:21 am

    As I know, you can specify the filename only in chrome 14+.
    Take a look at this question: Is there any way to specify a suggested filename when using data: URI?

    Update!

    If you want to download multiple csv files “at once”, you can zip them together, or save each file on the server separately (each file now has a url that points to it – if you place them inside the ‘www’ folder).
    Then send the file names and their path/url to the client via ajax (use a json encoded list for example).
    In the ajax callback function: take the list of the files and open each file-url in a separate popup.

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

Sidebar

Related Questions

I want to export TVP (Type of DataTable) to .csv file, or .xls, but
I want to export the audio-media of a MOV-File with the QuickTime-API and save
I want to export jar file with existing jar file in the project by
I am want to export database table to a file. I am using the
I want to convert my sql data to csv files while clicking on a
I'm trying to export data from an Excel spreadsheet into a fairly complex relational
I've exported my MySQL database to a .txt/.sql file (link) and want to use
I am trying to export data from my MySQL database to multiple CSV files
Coming up empty on this one and could use some insight. I'm try to
I'm exporting some mysql data to a text file. The data can be selected

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.