springboot project file download function - cut - Download file failure caused by the bug

Background: The use ResponseEntity and Resource combined spring provided to achieve download files function

bug: Resource has been loaded into the file, and by ResponseEntity constructed response, but the page does not receive the file.

The reason: the current preliminary finding is unusual because I used the section to capture leads, and how specific cut will lead to changes in the structure of the response, temporarily not thoroughly understand, follow-up study thoroughly and then add

The solution: the interface to download files excluded from the scope of the processing section, just fine.

Eat a cutting wisdom: a waste of time almost a day on this issue, very upset, I hope next time use a process of elimination, more efficient discovered the problem.

Guess you like

Origin www.cnblogs.com/zhoujl-5071/p/12085138.html