Different classes grails use to handle upload files

别来无恙 提交于 2020-01-06 02:22:36

问题


I have a grails controller which handle fileupload. I deployed the application on glassfish in windows and in ubuntu.

On windows deployment, the request object of

request.getFile("filename")

is of type commons.CommonsMultipartFile

while on ubuntu deployment the request is of type support.DefaultMultipart

What causes this different behavour? Is there a way to make it consistent?

The application server is glassfish3.1.2


回答1:


Anything grails supplies via the request.getFile(...) method should implement the Spring MultipartFile interface. As long as you stick to the methods available in the interface, you shouldn't need to worry about what concrete implementation you receive.




回答2:


the problem solved after I upgraded the glassfish from 3.1.2 to glassfish 4 in windows and ubuntu.

there may be some other ways to solve this. but i solved this by upgrading the glassfish.



来源:https://stackoverflow.com/questions/17628417/different-classes-grails-use-to-handle-upload-files

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!