Comments (9)
Ok After googling around for problems with chrome and blob urls I found out that was my adblocker the one preventing the downloads.
Maybe would be nice to leave a note in the docs that AdBlock or similar software will prevent this to work. Also my previous links seemed to work so maybe you want to take a look.
from react-csv.
I was running into this same issue. For me the problem was that the target="_blank"
attribute triggered my Adblock extension (v 3.27.0). Overriding this in the props allowed me to download the file.
<CSVLink data={this.state.data} target="" />
from react-csv.
This solved my issue with natively without react-CSV.
const link = document.createElement('a')
link.href = window.URL.createObjectURL(csv)
link.download = `filenName.csv`
link.dispathEvent(new MouseEvent('click'))
from react-csv.
This example seems to work in case you want to check it https://medium.com/@danny.pule/export-json-to-csv-file-using-javascript-a0b7bc5b00d2
from react-csv.
Using uBlock and experiencing the same issue. Is the link or download being done to standard?
from react-csv.
Can you please provide an example of code that won't download, the steps you took to download the file, as well as any other info about your browser and ad-blocking extensions?
from react-csv.
<CSVLink data={this.state.csvData} filename={"Revenue Report for " + this.state.monthNames[this.state.month] + ".csv"} className={styles.download} ><InputButton text="📥 Download Financial Report" /></CSVLink>
I'm using uBlock Origin (Version: 1.15.18) on Chrome (Version 65.0.3325.181 (Official Build) (64-bit)).
I think the download is being blocked as a pop-up.
from react-csv.
Thanks @andynoelker, worked like a charm.
from react-csv.
@timersys THANKS A LOT!
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.