From 1523c225344bd7c38ab3b54e7bccf8ef9e7a3184 Mon Sep 17 00:00:00 2001 From: Ace Nassri Date: Sat, 25 Apr 2020 19:19:44 -0700 Subject: [PATCH] GCF: add multipart file-persistence note (#3429) * Update main.py Given that we added this note in the Java sample, I thought it was worth adding here. * Update main.py --- functions/http/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/functions/http/main.py b/functions/http/main.py index df44076187a1..5b057d46b6b3 100644 --- a/functions/http/main.py +++ b/functions/http/main.py @@ -85,6 +85,9 @@ def parse_multipart(request): # This code will process each file uploaded files = request.files.to_dict() for file_name, file in files.items(): + # Note: GCF may not keep files saved locally between invocations. + # If you want to preserve the uploaded files, you should save them + # to another location (such as a Cloud Storage bucket). file.save(get_file_path(file_name)) print('Processed file: %s' % file_name)