Azure / Azure/azure-functions-host
HttpRequest files array contains only one file
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 38
Description
An Http Trigger function to handle two CSV files (only a few KBs each) results in a req.files object with only one file.
#### Investigative information
Please provide the following:
- Timestamp: 2023-01-03 22:01:00
- Function App version: 4.14.0.0
- Invocation ID / Operation ID: 1013f2707ddd27ee8215a5f8ec02c4a7
- Region: Canada Central
#### Repro steps
1. Submit a POST request to the function and add two form-data files in the body.
2. Print out the number of files in the request.files object, and the output will be 1.
#### Expected behavior
There should be two files (or more) in the HttpRequest 'req.files' object after performing a POST with two files (or more) in the body form-data array.
#### Actual behavior
There is only one file in the HttpRequesst 'req.files' object. The HttpRequest succeeds but the incorrect number of files are in the req.files object.
#### Known workarounds
None known.
#### Related information
* Programming language used : Python
Source
```python
import logging
import azure.functions as func
def main(req: func.HttpRequest) -> func.HttpResponse:
total_files = len(req.files)
logging.info(f"Number of files found: {total_files}.")
```
Contributor guide
Research direction
The report names no repository file or test; start by reproducing the POST from main(req: func.HttpRequest) with two CSV files and inspecting req.files. Trace where the multipart files are collected, then verify that both files and additional files are exposed and add regression coverage if the repository provides a relevant test area.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100