当前位置: 动力学知识库 > 问答 > 编程问答 >

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?

网友答案:

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.

网友答案:

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

分享给朋友:
您可能感兴趣的文章:
随机阅读: