Skip to content

File drawer doesn't show spaces in file names #2106

@kjhollen

Description

@kjhollen

The editor file drawer removes spaces from files to list them in the UI, but doesn't actually remove them from the file path. A common error I will see with my students is that they encounter an error using loadImage, loadTable, etc. because they use the name displayed in the file drawer, not knowing they need any spaces from the original file name.

Details about the bug:

  • p5.js version: n/a
  • Web browser and version: Firefox 102.7.0esr (64-bit)
  • Operating System: macOS 12.4
  • Steps to reproduce this: upload a file with a name like "test 2.csv" that has a space in the file name. The file drawer will display the filename as "test2.csv", eliminating the space, but using loadTable("test2.csv", "csv", "header"); will fail with a file not found error.

Example sketch: https://editor.p5js.org/kjhollen/sketches/2tDA5z8ZG

Metadata

Metadata

Assignees

Labels

BugError or unexpected behaviorsGood Medium IssueA moderately complex issue for contributors with some experiencePriority:MediumModerately important, should be completed in a fair timeframe

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions