cancel
Showing results for 
Search instead for 
Did you mean: 

Attachment in mobile services Can anyone guide me on how to set it up?

NoGu
Explorer
0 Kudos
302

I am using the attachment tool to capture images from the mobile device, how should I set it up so that the captured images are sent to a server and I can refer to them when I need them, where can I find documentation, what do you recommend I do? 

Accepted Solutions (0)

Answers (3)

Answers (3)

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

From your metadata you have a three level hierarchy  Equipment > Failure > Files.

So assuming the equipment already exists you could call CreateRelatedEntity to create the failure and associate it to the equipment.  Then call CreateRelatedEntity again to create the files entity relating it to the new failure and finally call UploadStream to store the attachment in the download property of the files entity.  

From the metadata it does not look like you can attach more than one file to the failure so you don't need to worry about looping over the list of attachments.  If it is desired to attach more than one you would need to modify your backend service to support a Collection of files associated to the failure.

NoGu
Explorer
0 Kudos

Hi @bill_froelich ,  do you know if there is any documentation where I can see an example of how I can call the UploadStream or how to make the modification to attach the collection of files?, sorry I am starting on this path and I don't know how to do some things.

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

For Upload Stream you can take a look at the documentation.  For changes to your backend service I am unable to help there as it will depend how you are creating the service (CAP, Netweaver, ECC, S/4HANA, etc).

NoGu
Explorer
0 Kudos

@bill_froelich

Hello the entity (failure) is the one I have related to the page of the visual part of the mobile application where I use the attachment tool. what can you recommend me?

 

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

The question is what does your odata service look like and expect with respect to storing of the images?  Do you have a v2 or v4 service?  Can you share the $metadata of the service so we can review and possibly provide some guidance.

NoGu
Explorer
0 Kudos
Hi the service is V4, sorry I don't know how I can share the metadata image without losing the thread of the conversation. in this way can you recommend or suggest me where I can find information about it, in odata I have tried to use different combinations like ‘#Control:fileName/#Value’ for the configuration but I don't know if it should be done somewhere else because I don't see it directs the image somewhere, maybe some special conversion configuration should be used to save the image?
bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

In Mobile Services under Mobile Connections you can click the Open in Browser button to launch a browser tab to connect to your service. After you see the service info you can change the URL to remove the ?auth=uaa and add /$metadata. Save the file and attach to the message or add as code in a reply.

You will also need to provide some hint as to what entity you are trying to create / update for your attachment.