apache / apache/grails-core

Grails 3.0.10: Cannot upload file with PUT method

Open
#9,462 8 comments 1 reaction 0 assignees View on GitHub
relates-to: rest status: awaiting feedback status: awaiting third-party
Dominant language
Groovy
Stars
2.9k
Forks
975
Avg merge
1d 22h
Merged PRs (30d)
92

Description

The line:

``` groovy
def f = request.getFile('attachment')
```

Produce the following error:

```
No signature of method:
org.grails.web.filters.HiddenHttpMethodFilter$HttpMethodRequestWrapper.getFile()
is applicable for argument types: (java.lang.String)
```

Html used:

``` html

...

```

The same issue is mentioned here https://github.com/grails/grails-core/issues/668 by pentagon.
The same form works correctly with the POST method.

Contributor guide

Open the contributing guide

Research direction

Start with the HiddenHttpMethodFilter$HttpMethodRequestWrapper error and compare the supplied uploadForm using PUT with the same form using POST. Review the related issue #668, then reproduce the request and confirm that request.getFile('attachment') works for PUT uploads without changing the existing POST behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.