I uploaded images to mongoDB using GridFS. I want to get an image from db and display it in a browser. How to do it with Sinatra and HAML.
This Sinatra application uses the old GridStore API, but the principle still applies. Create a separate URL for the images, set the content type, and call #read in the Grid method:
http://github.com/banker/mongodb_examples/blob/master/tweets/sinatra_tweets.rb
Source: https://habr.com/ru/post/1740756/More articles:SSRS 2008 + SSL Displays 404 Not Found - sslHow to form an optimal query to get high scores from a database? - databaseFloating window wpf - c #Allow Google to bypass CAPTCHA validation - is it reasonable or not? - phpCakePHP call a member function on a non-object - cakephpОбнаружение Нажмите браузер - javascriptmySQL removes the first digit - databaseShow part of XML file when parsing it - stringНе удалось создать классы миграции из разности (Zend Framework 1.10 + Doctrine 1.2.2) - zend-frameworkhow to download client content - javascriptAll Articles