{"id":286427,"date":"2017-05-16T15:25:05","date_gmt":"2017-05-16T11:25:05","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=286427"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=286427","title":{"rendered":"\u041b\u0443\u0447\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 Ruby \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Shrine. \u0427\u0430\u0441\u0442\u044c 2. \u0417\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a"},"content":{"rendered":"<p><i>\u042d\u0442\u043e \u0432\u0442\u043e\u0440\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0438\u0437 \u0441\u0435\u0440\u0438\u0438 \u043f\u043e\u0441\u0442\u043e\u0432 \u043e <a href=\"https:\/\/github.com\/janko-m\/shrine\">Shrine<\/a>. \u0426\u0435\u043b\u044c \u044d\u0442\u043e\u0439 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u2013 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 Shrine \u043d\u0430\u0434 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430\u043c\u0438 \u0444\u0430\u0439\u043b\u043e\u0432.<\/i>  <\/p>\n<hr\/>\n<p>  \u0412 <a href=\"https:\/\/habrahabr.ru\/post\/328558\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043f\u043e\u0441\u0442\u0435<\/a> \u044f \u0433\u043e\u0432\u043e\u0440\u0438\u043b \u043e \u0442\u043e\u043c \u0447\u0442\u043e \u043c\u043e\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043b\u043e \u043c\u0435\u043d\u044f \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 Shrine. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043c \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u0441\u043d\u043e\u0432\u0430\u043d Shrine \u2014 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b. <br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0425\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435<\/h2>\n<p>  <\/p>\n<hr\/>\n<p>  \u00ab\u0425\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435\u00bb Shrine \u2014 \u044d\u0442\u043e plain Ruby-\u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0435 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f (\u0444\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, S3 \u0438.\u0442.\u0434). \u0425\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 5 \u043c\u0435\u0442\u043e\u0434\u043e\u0432:<\/p>\n<pre><code class=\"ruby\">class MyStorage   def upload(io, id, **options)     # \u0432\u044b\u0433\u0440\u0443\u0436\u0430\u0435\u0442 `io` \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 `id`   end    def url(id)     # \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 URL-\u0430\u0434\u0440\u0435\u0441 \u0444\u0430\u0439\u043b\u0430 \u0441 `id`   end    def open(id)     # \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 `id` \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0442\u0438\u043f\u0430 IO   end    def exists?(id)     # \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435   end    def delete(id)     # \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0444\u0430\u0439\u043b \u0438\u0437 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430    end end <\/code><\/pre>\n<p>  \u0425\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 Shrine \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u043e\u043f\u0446\u0438\u0438 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 (\u043f\u043e\u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043e \u0443 Refile) \u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432 <code>Shrine.storages<\/code>:  <\/p>\n<pre><code class=\"ruby\"> Shrine.storages[:s3] = Shrine::Storage::S3.new(   access_key_id: &quot;abc&quot;,   secret_access_key: &quot;xyz&quot;,   region: &quot;eu-west-1&quot;,   bucket: &quot;my-bucket&quot;, ) <\/code><\/pre>\n<p>  \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f Shrine \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 <a href=\"https:\/\/github.com\/janko-m\/shrine\/blob\/master\/lib\/shrine\/storage\/file_system.rb\">\u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/a>, <a href=\"https:\/\/github.com\/janko-m\/shrine\/blob\/master\/lib\/shrine\/storage\/s3.rb\">S3<\/a>, <a href=\"https:\/\/github.com\/janko-m\/shrine-fog\">Fog<\/a>, <a href=\"https:\/\/github.com\/janko-m\/shrine-flickr\">Flickr<\/a>, <a href=\"https:\/\/github.com\/janko-m\/shrine-cloudinary\">Cloudary<\/a>, <a href=\"https:\/\/github.com\/janko-m\/shrine-transloadit\">Transloadit<\/a>, <a href=\"https:\/\/github.com\/janko-m\/shrine-uploadcare\">Uploadcare<\/a>, <a href=\"https:\/\/github.com\/janko-m\/shrine-imgix\">Imgix<\/a>, <a href=\"https:\/\/github.com\/janko-m\/shrine-gridfs\">GridFS<\/a> \u0438 <a href=\"https:\/\/github.com\/janko-m\/shrine-sql\">SQL<\/a>, \u0442\u0430\u043a \u0447\u0442\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0439\u0442\u0435.<\/p>\n<p>  \u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c <a href=\"http:\/\/shrinerb.com\/rdoc\/files\/doc\/creating_storages_md.html\">\u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e<\/a> \u0438 <a href=\"https:\/\/github.com\/janko-m\/shrine\/blob\/master\/lib\/shrine\/storage\/linter.rb\">\u043b\u0438\u043d\u0442\u0435\u0440<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442, \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043b\u0438 \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<h2>\u0417\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a<\/h2>\n<p>  <\/p>\n<hr\/>\n<p>  \u0417\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 Shrine, \u043e\u043d\u0438 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u044e\u0442 \u043b\u043e\u0433\u0438\u043a\u0443 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u043a\u0430\u043a \u0443 CarrierWave).<\/p>\n<pre><code class=\"ruby\">class ImageUploader &lt; Shrine   # image uploading logic goes here end <\/code><\/pre>\n<p>  \u041e\u0431\u044a\u0435\u043a\u0442\u044b Uploader \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u044e\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u0435\u0440\u0442\u043e\u043a \u0432\u043e\u043a\u0440\u0443\u0433 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430, \u0432 \u043d\u0438\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u0449\u0435\u0439 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430:<\/p>\n<ul>\n<li>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/li>\n<li>\u0418\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445<\/li>\n<li>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043b\u043e\u043a\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u0430<\/li>\n<li>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 (\u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0443)<\/li>\n<li>\u0417\u0430\u043a\u0440\u044b\u0442\u0438\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430<\/li>\n<\/ul>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430:<\/p>\n<pre><code class=\"ruby\">Shrine.storages[:disk] = Shrine::Storage::FileSystem.new(...)  uploader = ImageUploader.new(:disk) uploader.upload(image) #=&gt; #&lt;Shrine::UploadedFile&gt; <\/code><\/pre>\n<p>  \u0417\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0438 \u043d\u0435 \u0437\u043d\u0430\u044e\u0442 \u043e \u043c\u043e\u0434\u0435\u043b\u044f\u0445; \u041e\u043d\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u0444\u0430\u0439\u043b\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u043d\u0430 \u0432\u0445\u043e\u0434, \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442, \u0447\u0442\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f stateless, \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u0445 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b\u043c.<\/p>\n<h2>\u0417\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b<\/h2>\n<p>  <\/p>\n<hr\/>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u0444\u0430\u0439\u043b \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a, \u043c\u0435\u0442\u043e\u0434 <code>#upload<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 <code>Shrine::UploadedFile<\/code>. \u042d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u044b\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435.<\/p>\n<pre><code class=\"ruby\">uploaded_file = uploader.upload(image) #=&gt; #&lt;Shrine::UploadedFile&gt;  uploaded_file.id       #=&gt; &quot;43ksd9gkafg0dsl.jpg&quot; uploaded_file.storage  #=&gt; #&lt;Shrine::Storage::FileSystem&gt; uploaded_file.metadata #=&gt; {...} <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0437\u043d\u0430\u0435\u0442, \u043a\u0443\u0434\u0430 \u043e\u043d \u0431\u044b\u043b \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d, \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432:<\/p>\n<pre><code class=\"ruby\">uploaded_file.url               # generates the URL uploaded_file.download          # downloads the file to the disk uploaded_file.exists?           # asks the storage if file exists uploaded_file.open { |io| ... } # opens the file for reading uploaded_file.delete            # deletes the file from the storage <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0445\u0435\u0448\u0435\u043c. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0430 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0435\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443, \u044d\u0442\u043e\u0442 \u0445\u044d\u0448 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 JSON \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d \u0432 \u0441\u0442\u043e\u043b\u0431\u0446\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<pre><code class=\"ruby\">uploaded_file.data #=&gt; # { #   &quot;id&quot;       =&gt; &quot;df9fk48saflg.jpg&quot;, #   &quot;storage&quot;  =&gt; &quot;disk&quot;, #   &quot;metadata&quot; =&gt; {...} # }  uploaded_file.to_json #=&gt; '{&quot;id&quot;:&quot;df9fk48saflg.jpg&quot;,&quot;storage&quot;:&quot;disk&quot;,&quot;metadata&quot;:{...}}' <\/code><\/pre>\n<p>  \u041e\u0431\u044a\u0435\u043a\u0442\u044b <code>Shrine::UploadedFile<\/code> \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u043e\u0432. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 CarrierWave \u0438 Paperclip, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 \u0442\u0430\u043a\u0443\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0441 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 <code>CarrierWave::Uploader::Base<\/code> \u0438 <code>Paperclip::Attachment<\/code>.<\/p>\n<h2>\u0410\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f IO<\/h2>\n<p>  <\/p>\n<hr\/>\n<p>  Shrine \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 <code>IO<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043d\u0430 <code>#read<\/code>, <code>#size<\/code>, <code>#rewind<\/code>, <code>#eof?<\/code> \u0418 <code>#close<\/code> (\u043a\u0430\u043a \u0443 Refile). \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044f \u044d\u0442\u043e\u0442 \u0441\u0442\u0440\u043e\u0433\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043a\u0430\u0436\u0434\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f Shrine \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u044d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b, \u0430 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0442\u043e\u0433\u043e, \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0435 \u043b\u0438 \u0432\u044b \u0442\u0438\u043f\u044b <code>File<\/code>, <code>StringIO<\/code>, <code>ActionDispatch::Http::UploadedFile<\/code>, <code>Rack<\/code> \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 <a href=\"https:\/\/github.com\/janko-m\/down#streaming\">\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u0438\u043c\u043e\u043c<\/a>.<\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, <code>Shrine::UploadedFile<\/code> \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0442\u0438\u043f\u0430 <code>IO<\/code>, \u043e\u0431\u0435\u0440\u0442\u044b\u0432\u0430\u044f \u043b\u044e\u0431\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043f\u043e\u0434 \u0442\u0435\u043c \u0436\u0435 \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0441 \u043e\u0434\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u044b\u043c. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043a\u0430\u0447\u043a\u0438 \u043f\u0443\u0442\u0435\u043c \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043f\u0438\u044e S3, \u0435\u0441\u043b\u0438 \u043e\u0431\u0430 \u0444\u0430\u0439\u043b\u0430 \u0438\u0437 S3, \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 URL, \u0435\u0441\u043b\u0438 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0435\u0433\u043e.<\/p>\n<pre><code class=\"ruby\">cache = ImageUploader.new(:s3_temporary) cached_file = cache.upload(image)  store = ImageUploader.new(:s3_permanent) store.upload(cached_file) #=&gt; performs an S3 COPY request <\/code><\/pre>\n<p>  <\/p>\n<h2>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432<\/h2>\n<p>  <\/p>\n<hr\/>\n<p>  Shrine \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c <a href=\"https:\/\/github.com\/janko-m\/shrine\/blob\/master\/lib\/shrine.rb\">\u044f\u0434\u0440\u043e\u043c<\/a> (&lt;500 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430), \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041b\u044e\u0431\u044b\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b \u0447\u0435\u0440\u0435\u0437 <a href=\"http:\/\/shrinerb.com\/#plugins\">\u043f\u043b\u0430\u0433\u0438\u043d\u044b<\/a>. \u042d\u0442\u043e \u0434\u0430\u0435\u0442 \u0432\u0430\u043c \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u0432 \u0432\u044b\u0431\u043e\u0440\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0438 \u043a\u0430\u043a \u0434\u043e\u043b\u0436\u0435\u043d \u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043b\u044f \u0432\u0430\u0441 Shrine, \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043a\u043e\u0434 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435.<\/p>\n<pre><code class=\"ruby\"># Loads the processing feature from &quot;shrine\/plugins\/logging.rb&quot; Shrine.plugin :logging, logger: Rails.logger <\/code><\/pre>\n<p>  Shrine \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c 35 \u043f\u043b\u0430\u0433\u0438\u043d\u0430\u043c\u0438, \u0438 \u0432\u044b \u043b\u0435\u0433\u043a\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435. \u041f\u043b\u0430\u0433\u0438\u043d\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 Shrine \u2014 \u044d\u0442\u043e \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u044f <a href=\"https:\/\/github.com\/jeremyevans\/roda\">Roda<\/a>, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f <a href=\"https:\/\/twin.github.io\/the-plugin-system-of-sequel-and-roda\/\">\u043f\u0438\u0441\u0430\u043b<\/a> \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u043c.<\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0438 Shrine \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f (<a href=\"https:\/\/jbhannah.net\/articles\/carrierwave-concerns\/\">\u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 CarrierWave<\/a>).<\/p>\n<pre><code class=\"ruby\">Shrine.plugin :logging # enables logging for all uploaders  class ImageUploader &lt; Shrine   plugin :backup # stores backups only for this uploader (and its descendants) end  <\/code><\/pre>\n<p>  <\/p>\n<h2>\u0417\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/h2>\n<p>  <\/p>\n<hr\/>\n<p>  \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432, \u0438\u043c\u0435\u044e\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043e\u043d\u0441\u0442\u0440\u0443\u043e\u0437\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<h3>CarrierWave<\/h3>\n<p>  <\/p>\n<ul>\n<li>ActiveSupport \u2013 \u042f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435 \u0445\u043e\u0447\u0443 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u043c\u0430\u043d\u043a\u0438-\u043f\u0430\u0442\u0447\u0435\u0439<\/li>\n<li>ActiveModel \u2013 \u041f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e <a href=\"https:\/\/github.com\/janko-m\/shrine\/blob\/master\/lib\/shrine\/plugins\/validation_helpers.rb\">\u0431\u0435\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a<\/a>?<\/li>\n<li>MIME::Types \u2013 \u041b\u0443\u0447\u0448\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c MIME-\u0442\u0438\u043f \u0438\u0437 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430<\/li>\n<\/ul>\n<h3>Paperclip<\/h3>\n<p>  <\/p>\n<ul>\n<li>ActiveSupport \u2013 \u041e\u043f\u044f\u0442\u044c \u0436\u0435, \u044f \u0445\u043e\u0447\u0443 \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0435 \u0438\u043c\u0435\u0442\u044c \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043c\u0430\u043d\u043a\u0438-\u043f\u0430\u0442\u0447\u0435\u0439<\/li>\n<li>ActiveModel \u2013 \u041e\u043a\u0435\u0439, \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u0430\u043a ActiveModel, \u0442\u0430\u043a \u0438 ActiveSupport \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f ActiveRecord<\/li>\n<li>Cocaine \u2013 <a href=\"http:\/\/ruby-doc.org\/stdlib-2.3.0\/libdoc\/open3\/rdoc\/Open3.html\">Open3<\/a> \u043c\u043e\u043d\u0441\u0442\u0440\u0443\u043e\u0437\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438<\/li>\n<li>MIME::Types \u2013 \u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u043c\u0435\u043d\u044b MIME-\u0442\u0438\u043f\u0430 <a href=\"https:\/\/github.com\/thoughtbot\/paperclip\/issues?utf8=%E2%9C%93&amp;q=label%3A%22Spoof%20related%20or%20Mime%20types%22%20\">\u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b<\/a><\/li>\n<li>MimeMagic \u2013 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u0442\u0438\u043b\u0438\u0442\u044b <a href=\"http:\/\/linux.die.net\/man\/1\/file\">file<\/a><\/li>\n<\/ul>\n<h3>Refile<\/h3>\n<p>  <\/p>\n<ul>\n<li>RestClient \u2013 \u041c\u043e\u043d\u0441\u0442\u0440\u0443\u043e\u0437\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432<\/li>\n<li>Sinatra \u2013 \u042d\u0442\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u0445\u043e\u0442\u044f <a href=\"https:\/\/github.com\/jeremyevans\/roda\">Roda<\/a> \u2013 \u0431\u043e\u043b\u0435\u0435 \u043b\u0435\u0433\u043a\u0430\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430<\/li>\n<li>MIME::Types \u2013 \u041b\u0443\u0447\u0448\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c MIME-\u0442\u0438\u043f \u0438\u0437 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430<\/li>\n<\/ul>\n<p>  Shrine, \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0438\u043c\u0435\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043d\u043e \u043b\u0435\u0433\u043a\u0443\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u2014 <a href=\"https:\/\/github.com\/janko-m\/down\">Down<\/a>. Down \u2014 \u044d\u0442\u043e net\/http \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u0430\u044f <a href=\"https:\/\/twin.github.io\/improving-open-uri\">\u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442 open-uri<\/a> \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u043c\u0438 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430\u043c\u0438 Shrine.<\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, Shrine \u0432 \u0446\u0435\u043b\u043e\u043c \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u044b \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0435 \u043a\u043e\u0434 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435. \u0414\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u043e\u0432 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043a\u043e\u0434 \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, Shrine \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0432 35 \u0440\u0430\u0437 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 CarrierWave \u0431\u0435\u0437 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u0438 \u0432 7 \u0440\u0430\u0437 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u043c\u0438 (<a href=\"https:\/\/gist.github.com\/janko-m\/0d4269b9c7195b5e65cc947acf1cc028\">\u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a<\/a>) \u043f\u043b\u0430\u0433\u0438\u043d\u0430\u043c\u0438.<\/p>\n<h2>\u0418\u0442\u043e\u0433\u0438<\/h2>\n<p>  \u041a\u0430\u0436\u0434\u044b\u0439 \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, c \u043a\u0430\u043a\u0438\u043c \u0431\u044b \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u0432\u044b \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438, \u0432\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442. \u041e\u0441\u043d\u043e\u0432\u0430 Shrine \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 <code>Storage<\/code>, <code>Shrine<\/code> \u0438 <code>Shrine::UploadedFile<\/code>, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u043c\u0435\u0435\u0442 \u0447\u0435\u0442\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438 \u043e\u0431\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u044c.<\/p>\n<hr\/>\n<p>  <i>\u041e\u0440\u0438\u0433\u0438\u043d\u0430\u043b: <a href=\"https:\/\/twin.github.io\/better-file-uploads-with-shrine-uploader\/\">https:\/\/twin.github.io\/better-file-uploads-with-shrine-uploader\/<\/a><\/p>\n<p>  C\u0442\u0430\u0442\u044c\u0438 \u0438\u0437 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0440\u0438\u0438 \u0432 \u0431\u043b\u043e\u0433\u0435 \u0430\u0432\u0442\u043e\u0440\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:  <\/p>\n<ul>\n<li><a href=\"https:\/\/twin.github.io\/better-file-uploads-with-shrine-attachment\">Better File Uploads with Shrine: Attachment<\/a><\/li>\n<li><a href=\"https:\/\/twin.github.io\/better-file-uploads-with-shrine-processing\">Better File Uploads with Shrine: Processing<\/a><\/li>\n<li><a href=\"https:\/\/twin.github.io\/better-file-uploads-with-shrine-metadata\">Better File Uploads with Shrine: Metadata<\/a><\/li>\n<\/ul>\n<p><\/i><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/328788\/\"> https:\/\/habrahabr.ru\/post\/328788\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><i>\u042d\u0442\u043e \u0432\u0442\u043e\u0440\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0438\u0437 \u0441\u0435\u0440\u0438\u0438 \u043f\u043e\u0441\u0442\u043e\u0432 \u043e <a href=\"https:\/\/github.com\/janko-m\/shrine\">Shrine<\/a>. \u0426\u0435\u043b\u044c \u044d\u0442\u043e\u0439 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u2013 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 Shrine \u043d\u0430\u0434 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430\u043c\u0438 \u0444\u0430\u0439\u043b\u043e\u0432.<\/i>  <\/p>\n<hr\/>\n<p>  \u0412 <a href=\"https:\/\/habrahabr.ru\/post\/328558\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043f\u043e\u0441\u0442\u0435<\/a> \u044f \u0433\u043e\u0432\u043e\u0440\u0438\u043b \u043e \u0442\u043e\u043c \u0447\u0442\u043e \u043c\u043e\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043b\u043e \u043c\u0435\u043d\u044f \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 Shrine. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043c \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u0441\u043d\u043e\u0432\u0430\u043d Shrine \u2014 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b.   <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-286427","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/286427","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=286427"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/286427\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=286427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=286427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=286427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}