Binary content not saved correctly
Application Type
Traditional Web
Platform Version

The webapp was saving attachments (pdf, docx, pptx..) on disk and now we changed to save in database as binary due to confidentiality. For new files uploaded in the new method everything works fine.

For the old files, I created a timer to get files that are in disk and save in the new table but some get corrupted when I try to open (PDF, ppt..). Am I missing something?

The open file is the standard download binary widget. ("application/octet-stream" and content: GetFormFilebinaryById.List.Current.FORM_FILEBINARY.Binary)

Thank you!

Rank: #170

Hi Carolina,

Check if your file name stay with correct extension (pdf, docx, pptx.. ) in database and download, example:


Rank: #646

Yes, the filename seems to be correct. And not all give errors, just random ones.


Rank: #2

Hi Carolina,

I assume you have tried to open the source files on disk, to see if they open correctly? Also, you could use some non-OutSystems tools to compare the two files (from disk and from the database) to see where the corruption occurs?

Rank: #370

Hi Carolina, 

When reading the binary, you don't check for errors. So it can happen that it fails silently and in that case you're storing an empty binary. Can that be the case?