Comments (3)
after long search, i decided to use byte streaming instead which works as what i expected. Right now, i don't require to import csv file.
[HttpGet]
public async Task<IActionResult> Download([FromQuery] LogQueryResource queryResource)
{
\\ i apply filter, get the data and append to line.
byte[] buffer = Encoding.ASCII.GetBytes($"{string.Join(",", ColumnHeaders)}\r\n{data.ToString()}");
return File(buffer, "text/csv", "data.csv");
}
from aspnetcorecsvimportexport.
You will probably have to manually set the response type and stuff. I think it only works right now because the browser sees the .CSV extension
from aspnetcorecsvimportexport.
You would have to implement a normal GET request with parameters and also set the response to the correct media type. Or you could return all responses as a CSV.
from aspnetcorecsvimportexport.
Related Issues (15)
- Does this handle nested complex data? HOT 1
- NuGet package HOT 1
- Returning the data as a file? HOT 3
- Package divergence between damienbod/AspNetCoreCsvImportExport and damienbod/WebAPIContrib.Core HOT 1
- Generric import & export - for runtime file import
- Typo in project title HOT 1
- NuGet with .NET 3.0 updates?
- Demo code threw this exception HOT 2
- DateTime HOT 1
- System.InvalidCastException: Unable to cast object of type 'report_engine.Models.CustomerPlanModel' to type 'System.Collections.IList' HOT 7
- Default file name for exported csv file HOT 2
- Bug, improvement
- How to Upload File HOT 2
- Ignore Properties in CSV HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aspnetcorecsvimportexport.