Why do I get a "could not insert" error uploading an HTML form?

Hi , I’ve been following every step in this video Demo of Upload and download of files in html-form-entry module OpenMRS on Vimeo for file uploading but I still have these errors ,

how to solve this issue?

Ok so I’ve tried to recreate my concepts and then it worked, image upload works fine , but for file uploads like word , pdf file it shows the error above.

how to solve this

TIA :slight_smile:

The video you are watching refers to an earlier iteration of the “upload” functionality. However, I don’t know how much use this funcitonality gets, so you still may have found a “real” bug.

More details about the functionality can be found here:



Is the underlying concept of type complex, and does it have a handler associated with it? Which one?

Thanks! Mark

Yes it has a handler , which is the text handler, in the vid he used the text handler for uploading files like word and pdf, too bad that the version was an earlier iteration, question, is there a solution to this bug now?

thanks for the reply sir :slight_smile:

Hmm… I don’t have a ton of experience with the upload functionality, unfortunately. Can you try using the BinaryDataHandler or BinaryImageHandler instead and see if that works? If not, can you access the underlying catalina.out and post the full stack trace of the error? Hopefully there is something more useful farther down in the stack trace you posted above.


sorry just logged in today, will do try this now, thanks !

I tried using the binary data handler for uploading files, It successful when I upload pdf files, but when I upload doc/ docx files it cannot be viewed like how the pdf files are viewed , instead it will download a package binary file, which is not what I wan’t to happen

will look into this deeper

this what shows up then I upload a doc file

It is potentially because the client OS isn’t recognizing the file type?