Dave Anderson
Dave Anderson

Reputation: 755

SpringSecurityCore grails plugin breaks my (previously working) multipart upload form

Well not the form exactly - but the action that the form submits to.

Whats is happening is that SpringSecurity is wrapping the request in its own request context that obviously has a lot of security happening in it. My action that catches the POST request from the form breaks on this line:

def f = request.getFile('myFile')

with the error message:

No signature of method: org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestWrapper.getFile() is applicable for argument types: (java.lang.String) values: [myFile]

Anyone know how to get at the actual file from the request?

Upvotes: 3

Views: 760

Answers (2)

Rahul
Rahul

Reputation: 67

Just let me know if you are using or to submit your form. If possible please add your complete Form Code

Upvotes: 1

Burt Beckwith
Burt Beckwith

Reputation: 75681

Is your form a proper file upload form? It needs the enctype="multipart/form-data" attribute set. If you're using <g:form> you can switch to <g:uploadForm> which adds that for you.

Upvotes: 3

Related Questions