spring-guides / gs-uploading-files

Uploading Files :: Learn how to build a Spring application that accepts multi-part file uploads.

Home Page:http://spring.io/guides/gs/uploading-files/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add controller method that shows how to serve the uploaded files again

odrotbohm opened this issue · comments

Uploading the files is just one part of the story. Serving them in turn would be helpful to show as well.

Hey all, I am back with another set of students who'd like to server their uploaded files again ;).

I'm on PTO this week. Perhaps I can work on this next week.

No worries Greg, I just thought I bump the need for this improvement! Enjoy your PTO! :)

Looking at what's been implemented for this, the fix deployed didn't actually implement what I was thinking of in the first place. Th fix lists all files hosted but doesn't expose them again. The latter is what is not necessarily trivial (setting the mime type correctly, content-disposition headers etc.). So it would be cool if the guide also served the files initially uploaded again.

Applying what I've learned about Java NIO mixed with some Spring utility classes I think this guide could use a nice refresher.

Shall I create a new ticket? I guess just returning a Spring Resource and letting the HttpMessageConverter do the trick should be sufficient. Maybe adding the Content-Disposition header with a file name?

Feel free to open a new ticket and itemize what needs to be tackled. I'll
probably submit one commit that resolves them all.

On Mon, Jun 27, 2016 at 11:36 AM, Oliver Gierke notifications@github.com
wrote:

Shall I create a new ticket? I guess just returning a Spring Resource and
letting the HttpMessageConverter do the trick should be sufficient. Maybe
adding the Content-Disposition header with a file name?


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#9 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAS_AHgAXNuiAnSVLxh-hdCJKEtn30sKks5qP_wDgaJpZM4DJib5
.

Greg Turnquist | Senior Software Engineer | Pivotal
Mobile: +1 321-759-1143 | twitter/github/skype: gregturn |
gturnquist@pivotal.io

Pivotal.io http://www.pivotal.io

@olivergierke Check out the update to this guide. I think you'll really enjoy it.