erich.wanker Posted January 15, 2020 Share Posted January 15, 2020 Hello, please can someone help me with this "basic" question? i want to save a file with Fileupload in a database (BLOB Field of Firebird SQL Server) and i want to send file from Database to Client.. Has someone a example - how to do that ? AND: how can i Signature any document - before i store it in Database ( i must make a auditable System ) ThanX for help Erich Link to comment Share on other sites More sharing options...
Freeman35 Posted January 15, 2020 Share Posted January 15, 2020 Hello, https://stackoverflow.com/questions/29292596/save-load-objects-as-blob-in-a-database If I were you, I'm not save file to db. Make a folder, (I have not new version unigui) fileupload component saving file on server side. After saved this file move & rename it. then transfer file that from folder. Just save name and path to db. This is much better way. regards. Link to comment Share on other sites More sharing options...
Kattes Posted February 5, 2020 Share Posted February 5, 2020 On 1/15/2020 at 10:50 AM, Freeman35 said: Hello, https://stackoverflow.com/questions/29292596/save-load-objects-as-blob-in-a-database If I were you, I'm not save file to db. Make a folder, (I have not new version unigui) fileupload component saving file on server side. After saved this file move & rename it. then transfer file that from folder. Just save name and path to db. This is much better way. regards. I totally agree to Freeman35's post - Putting big files into a database makes everything slow and a backup of such a huge DB can become a nightmare! As already recommended, please put only file references to the DB. Link to comment Share on other sites More sharing options...
artem_niko Posted February 6, 2020 Share Posted February 6, 2020 On 1/15/2020 at 5:40 PM, erich.wanker said: Hello, please can someone help me with this "basic" question? i want to save a file with Fileupload in a database (BLOB Field of Firebird SQL Server) and i want to send file from Database to Client.. Has someone a example - how to do that ? AND: how can i Signature any document - before i store it in Database ( i must make a auditable System ) ThanX for help Erich Are you using FireDAC for connect Firebird Server? Link to comment Share on other sites More sharing options...
mierlp Posted February 6, 2020 Share Posted February 6, 2020 See my older answer: Link to comment Share on other sites More sharing options...
55143681 Posted February 6, 2020 Share Posted February 6, 2020 Someone Save files into database and someone save files in folders, They are all right. But the new problem is : if your project run in cluster servers, If your folders are not cluster, and your database are clusters,you should select save files in database. If your folders are cluster,and your database are not cluseters,you should select save files in folders. Most of all ,is the stabilization Link to comment Share on other sites More sharing options...
mierlp Posted February 6, 2020 Share Posted February 6, 2020 True ... every variant has its advantages and disadvantages. When you apply clustering, I can also assume that the database environment is also clustered. You can use load balancers for high availability and realize redancy. By using virtualization in combination with hyperconverged or converged server and storage platform, you can now build beautiful, stable and fast systems. Link to comment Share on other sites More sharing options...
Ron Posted February 7, 2020 Share Posted February 7, 2020 //insert into myfiletable values(0, :date, :filename, :file); with SaveFileQuery do begin paramByName('date').AsDateTime:=now; paramByName('filename').AsInteger:=uniFileUpload1.fileName; try blob := TMemoryStream.Create; blob.Seek(0, soFromBeginning); try blob.loadFromFile(myFileName); //if you have the file on disc myFastReport.SaveToStream(blob, true, true, false); //if you need to save a PDF report finally end; finally paramByName('file').LoadFromStream(blob, ftBlob); //if you use any of the above options paramByName('file').LoadFromStream(uniFileUpload1.stream, ftBlob); //if you have not saved the file yet ExecSQL; blob.Free end; end; Link to comment Share on other sites More sharing options...
erich.wanker Posted February 7, 2020 Author Share Posted February 7, 2020 Hello Ron, you define a filename as Integer? paramByName('filename').AsInteger:=uniFileUpload1.fileName; Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now