question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multipart request Issue

See original GitHub issue

Investigative 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:closed
  • Created 4 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
maiqbal11commented, Jul 25, 2019

@daker, we are rolling out this week. I believe it should be out in all regions by next week unless we hit some snags.

1reaction
dakercommented, Jul 18, 2019

@maiqbal11 yes it works as expected!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found