Best way to write an image using Flysystem? #854
-
Am trying to integrate Image with a Flysystem implementation. Wondering about the best way to write images out using the Flysystem "write" method. For that to work the image needs to be encoded in whatever image format is required before it is written. One option would be to write the image out to a local disk first and then copy that local file to the remote store - but wondering if there is a way to encode the image without writing to disk first? Would seem more elegant if so. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can use $filesystem->write($path, $image->get($format, $options), $config); |
Beta Was this translation helpful? Give feedback.
You can use
ImageInterface::get()
that returns the binary data of the image that you can then write to the Flysystem: