Using text/csv
is the most appropriate type.
You should also consider adding a Content-Disposition
header to the response. Often a text/csv will be loaded by a Internet Explorer directly into a hosted instance of Excel. This may or may not be a desirable result.
Response.AddHeader("Content-Disposition", "attachment;filename=myfilename.csv");
The above will cause a file “Save as” dialog to appear which may be what you intend.
Related Posts:
- HTTP Error 503, the service is unavailable
- How to resolve “Server Error in ‘/’ Application” error?
- Chrome returns “Bad Request – Request Too Long” when navigating to local IIS Express
- What does ‘IISReset’ do?
- What does ‘IISReset’ do?
- “Exception has been thrown by the target of an invocation” error (mscorlib)
- ORA-12154 could not resolve the connect identifier specified
- What are .ashx files in an ASP.NET application?
- Does PHP supports MVP pattern?
- Server.Transfer Vs. Response.Redirect
- W3WP.EXE using 100% CPU – where to start?
- HTTP Error 403.14 – Forbidden – The Web server is configured to not list the contents of this directory
- Error :The remote server returned an error: (401) Unauthorized
- Exception of type ‘System.OutOfMemoryException’ was thrown.
- Cannot read configuration file due to insufficient permissions
- A potentially dangerous Request.Form value was detected from the client
- Could not load file or assembly ‘Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed’
- How to Determine IUSR Password
- ASP.NET Why are sessions timing out, sessionstate timeout set
- What does aspnet_regiis.exe do
- drop down list value in asp.net
- Cannot read configuration file due to insufficient permissions
- Can you recommend a .net template engine?
- How do I resolve “HTTP Error 500.19 – Internal Server Error” on IIS7.0
- Asp.net Hyperlink control equivalent to
- Error ‘2035’ (‘MQRC_NOT_AUTHORIZED’) While Connecting to MQ
- debug=true in web.config = BAD thing?
- Url.Action parameters?
- What is the difference between ASP.NET and ASP.NET MVC?
- Failed to load resource: the server responded with a status of 401 (Unauthorized) /App/AngularJS/angular.min.js
- The following sections have been defined but have not been rendered for the layout page “~/Views/Shared/_Layout.cshtml”: “Scripts”
- The following sections have been defined but have not been rendered for the layout page “~/Views/Shared/_Layout.cshtml”: “Scripts”
- ASP.NET DateTime Picker
- Could not load file or assembly ‘Microsoft.CodeDom.Providers.DotNetCompilerPlatform
- a page can have only one server-side form tag
- “This operation requires IIS integrated pipeline mode.”
- Could not load file or assembly ‘Microsoft.ReportViewer.WebForms’
- Maximum request length exceeded.
- Could not load file or assembly Exception from HRESULT: 0x80131040
- The localhost page isn’t working. localhost redirected you too many times
- Unrecognized attribute ‘targetFramework’. Note that attribute names are case-sensitive
- IIS error, Unable to start debugging on the webserver
- How to move div vertically down using CSS
- How to troubleshoot “System.Web.HttpException (0x80004005): File does not exist”?
- jquery $(this).id return Undefined
- How handle Application Error Exception code: 0xc00000fd
- C# function to return array
- “The transaction log for database is full due to ‘LOG_BACKUP'” in a shared host
- jQuery UI ” $(“#datepicker”).datepicker is not a function”
- What is the difference between POST and PUT in HTTP?
- Do I need Content-Type: application/octet-stream for file download?
- csv.Error: iterator should return strings, not bytes
- The request was aborted: Could not create SSL/TLS secure channel
- Twilio TwilioRestClient does not contain a definition for SendSmsMessage
- how to call jquery selector from outside kendo window?
- System.web.mvc missing
- Differences between Html.TextboxFor and Html.EditorFor in MVC and Razor
- How to parse a CSV file using PHP
- How can I secure passwords stored inside web.config?
- TypeError: list indices must be integers or slices, not str
- Convert from CSV to array in Python
- Python import csv to list
- HTTP GET with request body
- “extra data after last expected column” while trying to import a csv file into postgresql
- System.ComponentModel.Win32Exception: Access is denied Error
- What is the @Html.DisplayFor syntax for?
- Could not find any resources appropriate for the specified culture or the neutral culture
- The server tag is not well formed error
- How to import CSV into Custom Post Type custom fields?
- Clarity needed on usage of multiple 403 forbidden header() functions at the beginning of the plugin files
- How can I use CURLOPT_USERPWD in wp_remote_post?
- Upgrade to SSL Breaks Admin Dashboard
- Export WordPress Table to CSV from page
- Export entries and multiple custom field meta to .csv?
- How To Reset Ownership And Permissions of Wp-Content Folder, In Order to Fix HTTP Error When Uploading Images to WordPress Media Library
- wordpress api using rest_route for other pages
- WordPress.com Stats stats_get_csv with custom field?
- Redirect HTTP to HTTPS for all sub domains (blog posts)
- Cron job update csv, need help solving :-)
- How to use https on one page only?
- Feed format for woocommerce [closed]
- How to get value of custom http header?
- How to make my site use HTTPS for images or how to insert images as relative paths?
- Last-Modified header support doesnât speed up server processing – want more
- Creating custom page template from existing PHP site
- What is this HTTP_REFERRER “WordPress/4.1.2”
- How to fetch csv file and show in shortcode
- How to send a particular csv file as an email?
- Why is that only the first row getting inserted into Mysql table when i import csv file on backend custom plugin?
- Export to csv adding html to file
- Updating the database after parsing CSV document
- How exactly does WordPress load themes from api.wordpress.org?
- how can i import the csv file in wordpress woocommerce.?
- How to switch static files back to using HTTP instead of HTTPS?
- throttle/limit a logged in user’s http requests to specific page on a per day basis
- CSS/JS is not working in multi lang installation
- Does WordPress perform better with curl installed?
- Any idea on how to fix this error when forcing SSL on a certain page?
- CSV import stopped working when I upgraded to WP 3.5.2
- is it possible to use wp cli to export custom post types