Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Fixed broken image serving in development server - #202

Closed
crohkohl wants to merge 1 commit into
NVIDIA:masterfrom
crohkohl:fix_file_serving
Closed

Fixed broken image serving in development server#202
crohkohl wants to merge 1 commit into
NVIDIA:masterfrom
crohkohl:fix_file_serving

Conversation

@crohkohl

@crohkohl crohkohl commented Aug 7, 2015

Copy link
Copy Markdown

Separation of changes in separate pull request: #199

On my machine the image serving, e.g. of the mean.jpg does not work.
The browser (tested IE and Chrome) cannot interpret the image probably due to the missing content type. The send_file function takes care of that all.

@lukeyeager

Copy link
Copy Markdown
Member

Thanks for the fix! Looks like I was working too hard.

Can we go ahead and use send_from_directory while we're at it? Then we wouldn't need any of the checks for path manipulation.
http://flask.pocoo.org/docs/0.10/api/#flask.send_from_directory

Also, watch your extra whitespace on line 246.

@crohkohl crohkohl mentioned this pull request Aug 7, 2015
@crohkohl

crohkohl commented Aug 7, 2015

Copy link
Copy Markdown
Author

send_from_directory sounds even better! Will you change that or should I do it?
I am still getting used to that white-space thin in python. All me editors use tabs ... I will need to adjust them.

@lukeyeager

Copy link
Copy Markdown
Member

I can't push commits to your fix_file_serving branch - you'll have to do that. FWIW, it seems to be this simple:

jobs_dir = config_value('jobs_dir')
return flask.send_from_directory(jobs_dir, path)

@crohkohl

crohkohl commented Aug 7, 2015

Copy link
Copy Markdown
Author

okay, I put in your suggested change and squashed the two commits

@lukeyeager

Copy link
Copy Markdown
Member

I fixed the docs merged this into master with 63a8456.

Thanks for the contribution!

@lukeyeager lukeyeager closed this Aug 7, 2015
@crohkohl
crohkohl deleted the fix_file_serving branch August 7, 2015 23:09
@crohkohl

crohkohl commented Aug 7, 2015

Copy link
Copy Markdown
Author

great!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants