grofit / aurelia-files

A simple attribute plugin for Aurelia to simplify loading files with the HTML5 FileReader
MIT License
15 stars 7 forks source link

Example of use? #12

Closed trondulseth closed 6 years ago

trondulseth commented 6 years ago

Great - I've created some cool UI around this, and it's working like a charm :)

Would be nice with an example on how to submit the filedata to a backend server/API compared to a traditional form submit with the old fashion <input type="file"> - and even though behind the scope of this plugin, how to save the data to a file on the server (with node)

grofit commented 6 years ago

Hey, sorry for not getting back sooner, generally I just produce bare bones examples as its a lot of time writing examples and stuff that are in depth, and I have too many open source libs to maintain so ones like this I generally leave for PRs to add stuff people want.

Just a word on the subject of interacting with servers though, I would generally just send back the base64 output from the file reader to your server as part of its payload, then get your server to turn the base64 into binary or whatever you want and save it somewhere.

trondulseth commented 6 years ago

Thank you for the answer - on the path of researching turning base64 strings into files on the server side now :)