Cannot upload or create .xml file into editor.p5js

Hi everyone,

Teaching the different data file format, I need to upload a .csv, .json and .xml file into p5.js web editor. Doing this, the editor gives an error message (after upload trial) : ‘You can’t upload files of this type’. When trying to create an empty .xml file, the editor says: ‘Invalid file type. Valid extensions are .js, .css, .json, .txt, .csv, .tsv, .frag, and .vert.’ So it’s impossible to work with .xml files…

I don’t see any reason to forbid adding .xml file to an online Processing project. Even more when p5.js librariy provides a loadXML() function and resources in order to process .xml data. Is it a bug or am I doing something wrong?

Thanks a lot for your attention and help!


Hello @Laurent

It is neither a bug nor are you doing something wrong. It’s by design, like it or not. :blush: Hopefully, someone will get back to you on the issue you created at the GitHub repository the other day.

If the project maintainers don’t want to add support for .xml files, you could always run p5.js locally for yourself. Or try another online editor, like OpenProcessing (I don’t know if it supports it, though).

Hello @Sven. Thanks for your lights about this question :smiley:. I hope a solution could be found in the close future, 'would be great. 'cause p5.js online editor is really a great tool for education. It helps when you have to give remote lessons during this difficult period. Asking young students to install Processing on their computer is always hazardous, with some of them telling you they have technical issues you cannot solve easily remotely. With p5.js online editor, students just need browser and everything works.

I just wonder why developpers have ‘prohibited’ to upload or create .xml files in online sketches. Forgotten to put .xml extension into authorized files type list? I just hope this is not for security reason.

By the way, as you mentioned it, I’ve opened an issue about this problem on Github. For those who are interested, here is the link:

Thanks again for answer and by the way thanks to all folks developping Processing, a really great tool to learn programming and going further with lot of fun!