I want to download the blob file from oracle database and save it to drive folder. Tried many ways but not getting the exact datatype for the image file.
Plzz help me out to find the easy way or direct activity in UiPath to save the blob file in a folder.
Hey @sarvesh.b
Could you please mention the ways you already tried, will be clear for us to provide alternative solutions or troubleshoot ?
Thanks
#nK
I had first connected a oracle database, then I had executed a query of select * from table name. In that table the data is in image as well as in text. So the text format data can be extracted but the image format data could not be extracted as it is showing the following output. I want to save that image and text in a file in local disk.
Hey @sarvesh.b
Here is the workaround for you to convert binary data blob to an image,
PFA - nmnithinkrishna_ByteArrToImg.zip (152.1 KB)
So you can perform the same for your table data. If you face any issues please let us know.
Hope this helps you.
Thanks
#nK
Hi friend, I cant able a to save the blob data from oracle database server with this workflow. Getting error in BYTE array assign activity as i need to extract the image from database server . Please help me out.
I use this code to save a blob file:
System.Data.OracleClient.OracleConnection connection = new System.Data.OracleClient.OracleConnection(connstring);
try
{
System.Data.OracleClient.OracleCommand cmd = connection.CreateCommand();
connection.Open();
cmd.CommandText = sql_text;
System.Data.OracleClient.OracleDataReader reader = cmd.ExecuteReader();
if (!Directory.Exists(savepath))
{
Directory.CreateDirectory(savepath);
}
byte bytData;
int idx = 1;
string file;
while (reader.Read())
{
bytData = (byte)reader[“BLOB_FIELD_NAME”];
if (bytData != null)
{
file = savepath + idx.ToString() +“_” + “.xml”;
FileStream fs = new FileStream(file, FileMode.OpenOrCreate, FileAccess.Write);
BinaryWriter br = new BinaryWriter(fs);
br.Write(bytData);
fs.Dispose();
}
}
reader.Close();
cmd.Dispose();
connstring, savepath , sql_text - arguments in Invoke Code