2016-01-15 54 views
0

我們使用HDIV來保護我們的web應用程序免受csrf攻擊。 最近我們嘗試使用ajax調用上傳文件(multipart),但它似乎不工作。 窗體文件參數在窗體中爲null。HDIV:ajax呼籲上傳文件無法正常工作

另外,我們有follwing消息:

Unable to find 'saveDir' property setting. Defaulting to javax.servlet.context.tempdir [org.hdiv.config.multipart.AbstractMultipartConfig] [getRepositoryPath() 124] 

任何想法如何解決這一問題? 謝謝

+0

即使沒有ajax,它仍然無法正常工作。參數爲null。 – kkung

回答

2

你配置了multipartresolver bean嗎?你能回顧一下你的Spring的配置,並確認你正在使用一個org.hdiv.web.multipart.HdivCommonsMultipartResolver類的bean嗎?

HDIV REference Documentation

戈爾卡| HDIV團隊

+0

我們的應用程序基於struts 1框架。我們不使用Spring MVC,或者可能會引用其他的東西。 – kkung

+0

你可以看到[這裏](https://github.com/hdiv/hdiv-struts-examples/blob/master/src/main/webapp/WEB-INF/upload/struts-config.xml)配置(controller )你必須添加到你的Struts配置文件中。我希望這對你有所幫助。 – Gorka