When I use rails send_file to display images inline, I can't see them in IE.

Asked 2 years ago, Updated 2 years ago, 118 views

I'm displaying the image with the following code.
When I looked at IE (I checked 9,11), I could not see it well.
Is there a solution?

stat=File::stat filepath
send_filefilepath, :filename=>'image.png', :length=>stat.size, :disposition=>'inline'

ruby-on-rails image internet-explorer

2022-09-30 21:11

1 Answers

It seems that you have not given the type (Content-Type), but is there a Content-Type that matches the content you are sending?For PNG, specify :type=>'image/png'.


2022-09-30 21:11

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.