I'm making a line graph and when I use: fetch('https://data.cdc.gov/resource/w9j2-ggv5.csv') everything works fine. When I download the csv file and try to read from my desktop I use: fetch('C:\Users\JoeKe\OneDrive\Desktop\w9j2-ggv5.csv') and it doesn't work. Can someone help please?!?
There's a different syntax for local files. Get it by opening the csv file with chrome/edge/firefox and it'll show you how the path should be written
If you're trying to open it in the browser, change the backslashes to forward slashes. C:/Users/JoeKe/OneDrive/Desktop/w9j2-ggv5.csv
You cant access local filesystem using javascript. For accessing the file using javascript, you have to upload it on a server. See here for more info: https://stackoverflow.com/questions/20138001/reading-files-from-hard-drive-with-javascript