Skip to content

Commit

Permalink
GCF: add multipart file-persistence note (#3429)
Browse files Browse the repository at this point in the history
* Update main.py

Given that we added this note in the Java sample, I thought it was worth adding here.

* Update main.py
  • Loading branch information
Ace Nassri authored Apr 26, 2020
1 parent 1e072f2 commit 1523c22
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions functions/http/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 1523c22

Please sign in to comment.