Downloading file from model and view in spring
0 2 | i'm trying to create a page where users can download some .log file. this is the code :
where am i doing wrong ? when i click on the download button it correctly ask me to save the file, but it is always a 0 byte file... | |||
1 | This should do the job:
where EDIT: Also, if you are using Spring MVC 3.1 you can do it in cleaner way (that's how I do it, turns out to be one-liner ;)):
and in your
so that you can return
| ||||||||||
|
2 | Try with:
you can find Apache Commons IO here: http://commons.apache.org/io/ Here you find | ||||
|
출처 - http://stackoverflow.com/questions/11762934/downloading-file-from-model-and-view-in-spring
'Framework & Platform > Spring' 카테고리의 다른 글
Spring – Dependency Injection Session Listener (0) | 2013.08.05 |
---|---|
spring - @Cacheable 적용 범위 (0) | 2013.07.26 |
spring data - mongodb gridfs example (0) | 2013.07.20 |
spring - Multiple File Upload Example (0) | 2013.07.17 |
spring data - mongoTemplate embedded document insert (0) | 2013.07.13 |
down_file.canRead()
return true? – Xaerxess Aug 1 '12 at 16:01