AspNetCoreCsvImportExport icon indicating copy to clipboard operation
AspNetCoreCsvImportExport copied to clipboard

Returning the data as a file?

Open VictorioBerra opened this issue 5 years ago • 3 comments

Can we see an example of how to respond as a file? Is it as easy as setting this? https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition

VictorioBerra avatar Oct 22 '18 22:10 VictorioBerra

Yes

https://github.com/damienbod/AspNetCoreCsvImportExport/blob/master/src/AspNetCoreCsvImportExport/Controllers/CsvTestController.cs#L18

Greetings Damien

damienbod avatar Oct 23 '18 05:10 damienbod

Thanks Damien. Does this work in all browsers? I thought you needed the special attachment header. What keeps the browser from just displaying the raw CSV text and instead serves up a file?

Tory

On Tue, Oct 23, 2018, 12:15 AM damienbod [email protected] wrote:

Yes

https://github.com/damienbod/AspNetCoreCsvImportExport/blob/master/src/AspNetCoreCsvImportExport/Controllers/CsvTestController.cs#L18

Greetings Damien

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/damienbod/AspNetCoreCsvImportExport/issues/13#issuecomment-432095349, or mute the thread https://github.com/notifications/unsubscribe-auth/ACzG62gLAJNJI5d8C_U7OSwSOEPReMwsks5unqYMgaJpZM4X0WvI .

VictorioBerra avatar Oct 23 '18 12:10 VictorioBerra

@VictorioBerra should work for all browsers, but I have not test with safari and IE

damienbod avatar Oct 24 '18 05:10 damienbod