Comments (16)
Our windows users are also experiencing this issue: That is, using CSVLink, file is downloaded without an extension.
from react-csv.
I am facing the same issue using CSVDownload on Chrome (Windows) but it is working fine on OSX.
from react-csv.
I believe this happens on windows only, correct?
from react-csv.
@kamarajuPrathi what issue are you having? If this is windows, its generally recommended to not have more than the one "." in the filename. This is likely not a react-csv issue
from react-csv.
On both windows and linux, it does not prompt you for a file name and directory. When you click the icon, it immediately downloads the file into the default download directly, with prop.filename as the file name and with no extension. On OSX it prompts and adds the csv extension.
from react-csv.
Correction: the "not prompting" is a browser setting. If it is set not to prompt (which is the default), then it saves the file without the cvs file extension on windows and linux, with on osx.
from react-csv.
Could this issue be related to browser MIME compatibility?
from react-csv.
Has anybody figured out a solution for this? It seems to only effect any browser on Windows.
from react-csv.
+1 experiencing this issue on Windows
from react-csv.
Workaround (hacky way) for this issue is to detect user agent's OS type. You can use https://github.com/duskload/react-device-detect to detect user's OS, and then add file extenstion (.csv) manually on non macOS user @kamarajuPrathi
from react-csv.
Is there any plan on fixing this? I find this issue quite a big one as it's affecting any browser on Windows (also saw this happening on Android, iOS and Linux, by the way)
from react-csv.
This is still happening on Windows OS, although working fine on OSX
from react-csv.
If anyone needs a quick fix for this one, what fixed it for me was manually adding '.csv' to the end of the filename that is passed to react-csv.
e.g. From a quick test, this works:
<CSVLink data={csvData} filename="Your filename.csv">Download me</CSVLink>;
There is a function already in the example website that does this.
Probably adding this logic to Link.js would fix it?
from react-csv.
Workaround (hacky way) for this issue is to detect user agent's OS type. You can use https://github.com/duskload/react-device-detect to detect user's OS, and then add file extenstion (.csv) manually on non macOS user @kamarajuPrathi
But how do i manually add that ?
from react-csv.
@matheusnasser you can append .csv
to filename
props inside if else statement.
from react-csv.
This can help to solve the problem:
#72 (comment)
from react-csv.
Related Issues (20)
- Can we download multiple tables in same file? HOT 1
- Start download while data is still being fetched from API calls HOT 1
- How to get it to ignore commas in strings within an array
- how to new line in cell HOT 1
- still getting UTF-8-BOM when setting prop uFEFF={false} HOT 1
- asyncOnClick = true together with onClick just doesnt work HOT 9
- is there any condition ' . ' must after ' " ' ? (need full stop after closing of double inverted comma)
- When the text contains double quotes, it will be divided into different columns. HOT 4
- File .csv not open directly with Excel HOT 1
- Data display vertically instead
- Module not found: Can't resolve 'prop-types' for NextJS project HOT 3
- Issue in async data
- [Object object] alert coming on CSVLink click
- The downloaded file is corrupted and cannot be open by microsoft excel
- Specify column order but not write headers
- Getting empty CSV files after upgrading to React 18 HOT 4
- Async Data HOT 3
- Detect the correct seperator
- Zip multiple files
- data attribute doesn't support function HOT 2
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 react-csv.