Cloud Functions for Firebase是否支持文件操作? [英] Does Cloud Functions for Firebase support file operation?
问题描述
我正在开发一个移动应用程序,它使用Firebase
作为后端.
我想使用
I am developing a mobile app and it is using Firebase
as the backend.
I want to compress some files immediately after they are uploaded to the Cloud Storage using Cloud Functions.
因此,我需要将数据写入临时文件,压缩完成后,我要将文件上传到Cloud Storage.
So I need to write data to a temp file and after the compression is done I am going to upload the file to Cloud Storage.
这可能吗? Firebase Cloud Function是否支持文件操作?
Is this possible? Does Firebase Cloud Function support file operation?
推荐答案
是的,您可以在运行函数的实例中写入/tmp.您可以看到使用ImageMagick针对临时对象图像处理的示例文件,以及提供的许多其他示例.
Yes, you can write to /tmp in the instance where your function is running. You can see an example of image manipulation with ImageMagick against a temporary file, along with many other samples that are provided.
这篇关于Cloud Functions for Firebase是否支持文件操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!