AI TOOLS

Share a dashboard that reads a CSV file as a link

Claude and ChatGPT often build dashboards that load data.csv with fetch or PapaParse. Opened from your computer, the data never arrives. Put the CSV inside the HTML file, upload it, and send one link.

4 min read·

Ask Claude or ChatGPT for a dashboard from a spreadsheet and the code often reads the data with fetch("data.csv") or Papa.parse("data.csv", { download: true }). It works in the chat preview. Saved next to the CSV and opened by double-clicking, the charts stay empty.

Moving the CSV into the HTML file fixes it and leaves one file to upload and share.

Empty page, error "blocked by CORS policy"

A page opened from your disk has a file:// address, and Chrome refuses to let it read other files with fetch or XMLHttpRequest. Tested in Chrome: fetch("data.csv") failed with "TypeError: Failed to fetch", and Papa.parse with download: true called its error handler. Both logged "Cross origin requests are only supported for protocol schemes" in the console.

Hosting the page alone does not fix it either: the link serves the one HTML file you uploaded, so a separate data.csv next to it on your computer is not there for viewers.

Put the CSV in the page

Paste the rows into a script block that the browser does not run, then parse its text:

  • ✓<script type="text/csv" id="data"> followed by the CSV rows, header row first, then </script>.
  • ✓<script src="https://cdn.jsdelivr.net/npm/papaparse@5.5.3/papaparse.min.js"></script>
  • ✓const rows = Papa.parse(document.getElementById("data").textContent.trim(), { header: true, dynamicTyping: true, skipEmptyLines: true }).data;
  • ✓Replace the fetch or download call with that line and pass rows to the charts as before.
  • ✓Tested in Chrome from file:// with PapaParse 5.5.3: three rows parsed into objects with the right column names, no network request for the data.

Totals look wrong or bars do not draw

CSV has no types, so every value arrives as text. Tested: without dynamicTyping, sales came back as "120", a string. Adding the numbers then joins them ("12080") and some chart libraries skip the values. dynamicTyping: true turns number-like values into numbers; in the same test sales came back as 120.

Upload it and send the link

Drag the file onto the FileShare Pro dashboard and copy the link. Viewers need no account and see the charts with the data already in them.

Turn on comments and readers can pin questions to a chart after typing a name. When the numbers change, paste the new rows into the data block and upload the file over the old one; the link stays the same: updating a shared link without changing it.

Related: sharing a Chart.js chart as a link, sharing an Excel sheet as a web page and why a page that works in chat breaks when hosted.

Frequently asked

How big can the CSV be?

The whole HTML file counts, data included. The free plan accepts files up to 100 MB; Pro accepts up to 250 MB. A browser parses a few megabytes of CSV quickly; much larger files make the page slow to open.

Can viewers load their own CSV instead?

Yes. Add <input type="file" accept=".csv"> and pass the chosen file to Papa.parse(file, { header: true, complete }). A file the viewer picks is allowed; it is only reading files by address that the browser blocks.

Is the data private?

Anyone with the link can open the page and read the data inside it. Password-protected links are on Pro, and you can keep the page out of search results: sharing a preview without Google finding it.

Got a page to share?

Drop the file, copy the link — live in seconds, free plan included.

Start sharing free