It might be … but its probably out of my league as I am not really a good PHP programmer.
If someone can help me do this in PHP then we can probably get it done. I think the .arduboy format will just have to be unzipped into a temp directory and then we could probably parse that info. At the moment, their is only a success / failure notification back to the front-end client whereas this would change it up a bit and require those data points come back from the server as part of the ‘success’ notification. Possible!
There’s a JSON schema somewhere on the forum, but it looks like you’d need a 3rd party library to validate based on a schema. But then again, I’m not sure you’d really need to validate it to that scale. Perhaps having the correct fields of the correct types is enough?
I would have said maybe some of the work could be done in the browser (i.e. with JavaScript), but there’s always a chance someone will try to bypass that, so you probably need on-server validation either way.
Yes, I found those same / similar PHP and ZIP references. I know it can be done, just not in the framework I have already to load up a HEX file. I would need to do something different - maybe a new web page or something - to handle this exception.
Unziping on the client side would be interesting.
Of course, anyone who has made an .arduboy file probably has the individual files already so they could simply load those up.
This is what I was originally thinking. Similar to this demo, where you’d choose a file and a bunch of client side js would extract from the file and populate the fields of the form for you (no change to server code or client-server messaging).
Definitely a fair bit of work compared to the small convenience it provides. Maybe I’ll give it a shot at some point.
I didn’t realise that unzipping something client-side could be this easy. I have muddled my way around JQuery to the point of getting this cart builder working but I would never call myself an expert.
I have merged that. I put the button down the bottom (with a particularly dodgy piece of CSS) and added a Licence on your JS (to match the remainder of the site).