Multipart request Issue
See original GitHub issueInvestigative information
Please provide the following:
- Timestamp:
- Function App name:
- Function name(s) (as appropriate): Http Trigger
- Core Tools version: 2.7.1158
Repro steps
Provide the steps required to reproduce the problem:
Create an Http trigger with the code below
Send a multipart form with a file I tried with curl curl -F filepond=@monalisanight.jpg http://localhost:7071/api/fpupload and with filepond component in react https://github.com/pqina/filepond
Expected behavior
It should save the same file in a blob and in the local drive
Actual behavior
The file is saved with a wrong size like approximately double size of the original size
Related information
Provide any related information
- Links to source
- Contents of the requirements.txt file
- Bindings used
Source
"scriptFile": "__init__.py",
"bindings": [
{
"authLevel": "function",
"type": "httpTrigger",
"direction": "in",
"name": "req",
"methods": [
"post"
]
},
{
"name": "outputblob",
"type": "blob",
"path": "test/toto.jpg",
"connection": "AzureWebJobsStorage",
"direction": "out",
"dataType": "binary"
},
{
"type": "http",
"direction": "out",
"name": "$return"
}
```python
def main(req: func.HttpRequest,outputblob: func.Out[func.InputStream]) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request.')
filetoup = req.files['filepond']
filetoup.save("/mnt/c/experiments/toto.jpg")
filetoup.stream._file.seek(0)
dataout=filetoup.stream._file.read()
outputblob.set(dataout)
return func.HttpResponse(
status_code=200
)
azure-functions==1.0.0a4
azure-functions-worker==1.0.0a4
grpcio==1.14.2
grpcio-tools==1.14.2
protobuf==3.6.1
six==1.11.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
MultipartException: Current request is not a multipart request
It looks like the problem is request to server is not a multi-part request. Basically you need to modify your client-side form. For...
Read more >Multipart Requests - Swagger
Multipart requests combine one or more sets of data into a single body, separated by boundaries. You typically use these requests for file...
Read more >Multipart Request Handling in Spring - Baeldung
In this tutorial, we'll focus on various mechanisms for sending multipart requests in Spring Boot. Multipart requests consist of sending ...
Read more >Uploading files with multipart/form-data request #121 - GitHub
Is there a way to make a multipart/form-data request using bent? The goal is to send a JSON body and one or more...
Read more >Troubleshooting issues with adding attachments to rest ...
If you send an attachment in a multipart message, the default request can have data in headers that may be considered incorrect by...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@daker, we are rolling out this week. I believe it should be out in all regions by next week unless we hit some snags.
@maiqbal11 yes it works as expected!