I’m experimenting and learning about p5js for a new project I’m about to start. I got quite some processing experience but very little p5js experience. What I’m trying to do is make a SVG with p5.svg.js and trying to edit the library in such a way that I’m able to save the file to my server rather than downloading it to the webbrowser. I tried http posting the data uri to NodeJS but the problem is that I can’t turn the url into a file from there.
What would be a ideal way would be to have a hidden file input field on the page the p5js sketch is running in and have p5js input the file into the hidden field. This is off course a hacky way to do it but ideal because its all php from there on.
Would this be possible and what would be other(less hacky) ways to tackle this problem?
Edit: One way I found to do it is by putting the data uri in a text field. Other ideas are still appreciated.
That would probably work yes. SQL would be great even. I’m trying to setup a webshop with algorithmically created products so SQL sounds like the way to go. But how
Ok, so WP will be delivering the pages. Depending of what you want to store, you could use WP to store into the database. Or you can send the info to nodejs. In node, you should be able to save the file. You need to check your server provider to see what options it offers you for storage.