Fetching attachment in Rollbase Mobile - Forum - Rollbase - Progress Community

Fetching attachment in Rollbase Mobile

 Forum

Fetching attachment in Rollbase Mobile

This question is not answered
Screenshot_2014-11-06-10-55-09.png

Hi all,

I'm having troubles fetching attachments from Rollbase Mobile. When I try displaying it by mapping the rollbase attachment field to a HTML element in mobile, it only returns the name of the attachment and no content.

So I found a way of getting the attachment from prod1/servlet/File, which I put in a <object> tag in a HTML element. This works fine, but now I have a "permission denied" issue when getting the attachment (this is correct since I'm not logged in to prod1). Getting the document from REST (rest/servlet/File) returns a 404 error.

Any suggestions how I can do this?

All Replies
  • Hi,

    Is this a file upload field you are trying to view into the mobile app?

    Regards,

    Orchid

  • Hi Orchid,

    Forgot to mention, yes it is a file upload.

    The workaround I describe, is a tirgger which fires everytime the file upload changes. It fills a textarea with the URL of the file uploaded. But no success.

    But main problem is, that I cannot show/view a file upload field.

  • Ok, let me test this first if could replicate the issue or find another option if there is.

    Thanks,

    Orchid

  • Hi Harrie,

    I can now view file upload field in mobile.

    I use "Link" component instead of label, and in my Rollbase app I created a text field to store the URL of the file upload field and map it the Link component.

    Regards,

    Orchid

  • Hi Orchid,

    Thank you for your suggestion, but unfortunaly it doesn't work on mobile devices. The problem is that I'm not logged into prod1 when I'm using a mobile device. I'm only logged into the rest servlet. When accessing the link with the attachment, the phone tries to connect with prod1 where I'm not authenticated.

  • I see, I only tested it in browser emulator from the builder and it was working fine.
    Will try this in real device and look for alternative way.

    Regards,
    Orchid
  • Do you have updates on this issue?

  • Viewing an attachment in a mobile App in not supported yet.

    The Issue is on clicking the link of the Url is directed to browser for displaying the attachment. The session is created in Mobile app, so the browser will get session issues when accessing the link ( unauthenticated).

    So one solution is to create a web preview widget from an url in the Mobile app builder.

    We will address this in next releases.

  • Creating the web preview widget didn't work, I already tested that like I said in my first message of this thread. That's because you authenticate with the REST servlet, and you get the file from the Storage servlet.