Home » Community » Coffee corner » saving and reading pdf file, binary file, image file in mysql
saving and reading pdf file, binary file, image file in mysql [message #57087] |
Sun, 23 May 2021 14:10  |
BetoValle
Messages: 204 Registered: September 2020 Location: Brasil Valinhos SP
|
Experienced Member |
|
|
Hi,
I did a test by uploading a pdf file to a variable string and then saved it to mysql. Then I read the content for string, and saved it as a pdf. The result was totally incorrect. How can I do this considering pdf, binary and image files?
String pdf="file.pdf";
String bf ="file.exe";
String if ="file.png";
//how to load Files to save in mysql?;
sql.Begin();
String st="INSERT INTO test ";
st += "(PDF,BF,IF)";
st += " values (?,?,?)";
sql.Execute ( , , );
sql.Commit();
String st="select * from test ";
sql.Execute (st);
while ( sql.Fetch() )
{
? SQL["PDF"]
? SQL["BF"]
? SQL["IF"]
}
//how to write content in files ?
SaveFile(fpdf,?);
SaveFile(fbf,?);
SaveFile(fif,?);
Thanks!
|
|
|
Goto Forum:
Current Time: Wed Apr 30 02:51:11 CEST 2025
Total time taken to generate the page: 0.03907 seconds
|