Uploading image/file to assets through code?


#1

How can I upload an image/file to the assets or just to the normal directory (doesn’t matter) through the code and obviously when I do that to be able to retrieve the url or path to this file all from inside the code?


#2

If you look through all kinds of code within the editor you’ll probably find the endpoint the API uses, and you’ll most likely be able to replicate the method.


#3

Exercise 13 in our Node tutorial has some sample code for uploading a file to the local filesystem from a form and displaying it, and the readme explains how it works: https://glitch.com/edit/#!/mountain-belly (https://glitch.com/~node-beginner)