inserting image into mysql database

0

If I want to insert an image into the database, just use the following query:

INSERT INTO teste (Id_Blob,Na_Imagem) VALUES (1,LOAD_FILE("C://imagem.png"));

If I want to insert an image that is on another computer on the network, how does this vary? I'm trying to use the following code.

INSERT INTO teste (Id_Blob,Na_Imagem) VALUES (1,LOAD_FILE("///10.1.1.10//Fotos//2.png"));

But the longblob image field is empty.

    
asked by anonymous 18.06.2015 / 02:16

1 answer

0

I solved my problem with a POG (kkkk) is not the best way, but solved. I used **File.Copy()** , copied the file from the virtual machine to the location (where the application is running). I created a variable to store the path of the file saved on the local machine. and I used the command:   INSERT INTO teste (Id_Blob,Na_Imagem) VALUES (1,LOAD_FILE("VariavelCaminho"));

If someone else has another solution please share This link " Save Image in Mysql "teaches to do this, but particularly I could not do it, because I work with classes, and I have a class to connect to the bank. That's it. #POG in the head

    
20.06.2015 / 20:26