spring-guides / gs-uploading-files

Uploading Files :: Learn how to build a Spring application that accepts multi-part file uploads.
http://spring.io/guides/gs/uploading-files/
Apache License 2.0
469 stars 503 forks source link

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

Closed odrotbohm closed 8 years ago

odrotbohm commented 9 years ago

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

odrotbohm commented 8 years ago

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

gregturn commented 8 years ago

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

odrotbohm commented 8 years ago

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

odrotbohm commented 8 years ago

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.

gregturn commented 8 years ago

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

odrotbohm commented 8 years ago

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?

gregturn commented 8 years ago

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 https://github.com/spring-guides/gs-uploading-files/issues/9#issuecomment-228800858, 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

gregturn commented 8 years ago

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