Mime Type doesn't work correctly

Mime Type doesn't work correctly

  

Hi guys,


I'm a newbie in Outsystems, but I have an issue with this logic to validate a file type uploaded:


The problem I figure out: when I upload any file (pdf, doc even jpg) the condition set always to false.


I tried to change the if condition to pdf /png and the behaviour is always the same.


Any help?

Hi jponte,

The file type should be "image/jpeg". Try that to see if it works.

Another thing that you can also do is to put in the feedback message the output of the UploadImage: UploadImage.Type

This way you can check what is the output that comes out of the Upload widget.

Cheers,

José

José Costa wrote:

Hi jponte,

The file type should be "image/jpeg". Try that to see if it works.

Another thing that you can also do is to put in the feedback message the output of the UploadImage: UploadImage.Type

This way you can check what is the output that comes out of the Upload widget.

Cheers,

José


Thanks to reply fast. Actually your solution doesn't work.

I erase the if condition and set again, and Mime Type: image/png, jpeg or jpg doesn't work.


Hi jponte,

What I was suggesting was this:

- Have just the feedback action:

- In the Message Text put:

This way you can see what is the mime type and then set the condition accordingly.

Could you try this and let me know if it worked?

Cheers,

José

Did you happen to set the upload button's action to Ajax submit? In this case it won't work. The Type will be empty and the binary will also be empty. You need to set the button's action to Submit.