Sharing PDF's between web and mobile application
Application Type
Traditional Web
Service Studio Version
11.52.2 (Build 59834)

Hello,

I have a mobile and a traditional web application.

Currently, they both access content in an external database and load content from this on demand. 

I now wish to 

  1. Store PDF's into the database
  2. Enable an offline mode, so the mobile application can load the PDF's, even when there is no signal.

I understand there is a performance and financial cost associated with binaries in databases. There may be 200 PDF's in total, and external platforms may need to access the content also, so not sure if there's a better way?

At the moment, I'm struggling to store the files in the database :-|

The structure of the table is

Field Type Size
id INT 11
DocID INT 5
Binary Binary 255
ImplementDate DATETIME

I've also tried VarBinary with max size.

I've built a form in web app. OML attached, see Administration->Document Detail and then Add PDF button.

At the moment, I either get null binary values, or have gotten "Data too long for column 'Binary' at row 1" errors at some point during my endeavours.

I'd really appreciate any direction you could offer.

Thank you.


WebApp.oml

Solution

What is 255, in Binary binary 255. In OutSystems when we create binary datatype filed its simply contained binary data. I think due to this 255.

Also did you checked that there is warning and asking to use Submit method instead of Ajax submit.

I think after this change it will work. If still doesn't work let me know.

Regards

Thank you.
I swapped to submit, instead of ajax submit, as you suggested.

I was then getting the 'Data too long for column 'Binary' at row 1' error.

In Google MySQL, the binary field type was limited to 255, and varbinary wasn't big enough either, so I changed the field type to BLOB, and now storing the file works fine.

Just have to figure out retrieving and displaying it now!
Thank you.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.