File path for loading table

I have to load a file in a different folder.
the current folder is “FileConverter”, and i have to open at “upload/FDR.csv”

1

I try the following code but it doesent work

function preload(){
  
    table = loadTable("../upload/FDR.csv",'csv','header');   
  }

  function setup(){
...

For privacy & security reasons browsers block any access to files outside the folder where the JS app (its “.html” file) is running! :eye:

For such cases, we can request the user to drop the file onto an element: :droplet:
https://p5js.org/reference/#/p5.Element/drop
http://p5js.SketchPad.cc/sp/pad/view/ro.CYTkHWj9smgw8Q/latest

Or open a file dialog: :file_folder:
https://p5js.org/reference/#/p5/createFileInput


1 Like