Hi,

I would like to use curl to retrieve an image from a web server which I want to store in a table in a mariadb database without downloading the image to a file. For this application, I do not want to store references to files stored in some file system instead.

So I would want to use something like


my $binary_data = `curl -k "https://www.example.com/some.jpg"`;


The image then needs to be inserted into a LONGBLOB field via DBI in such a way that the image can be restored as it was.

Will string conversions or something prevent this from working?

What is the usual way to do this? It is certainly not ideal to have no check on the amount of data that might be retrieved from the web server, regardless whether I save it to an intermediate file or not.

To make things more difficult, the web server is using a self-signed certificate.

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to