README
runEveryPeriod: midnight
------------
All temporary assets that were created more than 24 hours ago and are still there, will be removed by this function.
This allows us to easily delete assets without concequences and also if the user closes a form without submitting it, these assets uploaded will go away.
This function should be executed using a daily CRON
Returns a server.reply.download
or server.reply.file
but also sets the Content-Disposition
header correctly and the Content-Type
For this I finally ended up using builtin server.js stuff, we don't need to set those manually...
See https://serverjs.io/documentation/reply/#file- And https://serverjs.io/documentation/reply/#download-
See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition
NB: ensure to return the result of this function in your endpoint, otherwise it won't work
Uploads an asset to the server, and puts it in a temporary location in the assets folder of function-server
. It returns the filename of the file in the temporary location.
It can only be accessed through that random name. This random name has 32 characters so cannot be easily guessed. This should be secure enough. The file should be moved to the final destination in the actual function that needs the file.
NB: this function only works by providing a file as blobs under the "file" property name!
README
runEveryPeriod: midnight
------------
All temporary assets that were created more than 24 hours ago and are still there, will be removed by this function.
This allows us to easily delete assets without concequences and also if the user closes a form without submitting it, these assets uploaded will go away.
This function should be executed using a daily CRON
Returns a server.reply.download
or server.reply.file
but also sets the Content-Disposition
header correctly and the Content-Type
For this I finally ended up using builtin server.js stuff, we don't need to set those manually...
See https://serverjs.io/documentation/reply/#file- And https://serverjs.io/documentation/reply/#download-
See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition
NB: ensure to return the result of this function in your endpoint, otherwise it won't work
Uploads an asset to the server, and puts it in a temporary location in the assets folder of function-server
. It returns the filename of the file in the temporary location.
It can only be accessed through that random name. This random name has 32 characters so cannot be easily guessed. This should be secure enough. The file should be moved to the final destination in the actual function that needs the file.
NB: this function only works by providing a file as blobs under the "file" property name!