Skip to Content
avatar image
Former Member

Agentry Upload File Step from iOS works on Windows but not iOS

I have used this guide to configure my Agentry project to upload files back to the SMP File System: https://wiki.scn.sap.com/wiki/display/SAPMOB/Attach+Documentation+-+Uploading+files+to+the+Agentry+Server

This is working fine with the Windows client, but the iOS client is not uploading the attachment or throwing an error within the Agentry client.

Here are the log entries for both clients (everything else in the log is the same):

WINDOWS:

2017/01/17 08:55:38.938: + BackEnd=File-NewFileSystemConnection2

2017/01/17 08:55:38.938: Begin command line step

2017/01/17 08:55:38.938: Script file 'C:\Windows\TEMP\ag31F58.bat' is 26 bytes

2017/01/17 08:55:38.938: Command Line: copy C:\Users\me\Documents\255.geodatabase D:\MobileData\Uploads

2017/01/17 08:55:38.938: Waiting for command: copy C:\Users\me\Documents\255.geodatabase D:\MobileData\Uploads

2017/01/17 08:55:38.985: Command completed with exit code 0

IOS:

2017/01/17 08:40:48.618: + BackEnd=File-NewFileSystemConnection2

2017/01/17 08:40:48.618: Begin command line step

2017/01/17 08:40:48.618: Script file 'C:\Windows\TEMP\ag38987.bat' is 26 bytes

2017/01/17 08:40:48.618: Command Line: copy /var/mobile/Containers/Data/Application/C16234D1-50DA-4496-AE9E-B009A710BDCF/Documents/255.geodatabase D:\MobileData\Uploads

2017/01/17 08:40:48.618: Waiting for command: copy /var/mobile/Containers/Data/Application/C16234D1-50DA-4496-AE9E-B009A710BDCF/Documents/255.geodatabase D:\MobileData\Uploads

2017/01/17 08:40:48.634: Command completed with exit code 1

The only difference I see is that the iOS client completes with an exit code of 1 but i do not know how to get any more information.

I am downloading the file from within the app so I am fairly confident that the file is in the correct location to be uploaded. I have tried to upload the attachment from both the Application Support and the Documents folder and the behavior is the same for both.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jan 17, 2017 at 07:37 PM

    The transaction update steps is for identifying what the SMP server should do with the uploaded file after it receives it from the client. The client handles the upload to the server automatically.

    For example, in my application I have a File System Document Management Step that handles receiving the file from the client onto the file system of the server. I defined a Document Mapping of type File Input to Command Line that maps the property from the transaction (external data type) to the file name (using globals and transaction references) that defines where the file name it will be created on the server.

    File Name: <<FileAttachments.UploadedAttachments>>\<<transaction.documentid>>_<<transaction.FileName>>

    I then have two additional steps, the first to call a step to add the reference to my customer in this case. The second step then moves the file from where it was uploaded to and renames it based on the actual id values received back after attaching it to the customer and moves it to the permanent location where it will be downloaded from when the customer object is downloaded.

    You would need to post more details about your specific transaction and the associated steps if this doesn't answer the question.

    --Bill

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Bill - thank you for the response, but I am not sure I completely follow.

      I thought my configuration was correct because it works when using the Agentry Test Environment (on Windows server).

      When I try my application on the iPad it does not work.

      Here are some screenshots of my configuration starting at the transaction server update step:

      EDIT: One thing to point out is that <<fetch.SketchFileLocation>> resolves differently based on the environment (as shown in log). Windows = C:\Users\me\Documents\255.geodatabase and iOS =

      /var/mobile/Containers/Data/Application/C16234D1-50DA-4496-AE9E-B009A710BDCF/Documents/255.geodatabase

      j0pgk.png (26.3 kB)
      gsrqr.png (8.4 kB)
      wtrqm.png (16.3 kB)
      zftmn.png (18.5 kB)
  • Jan 18, 2017 at 05:29 AM

    The reason the ATE works is because the ATE is on the same physical machine as the SMP server so it can access both the client drive and server drive at the same time. Your Upload step should be using a Document Mapping to allow the client and server to automatically upload the file from the client to the specified location in the document mapping.

    Once uploaded, if you need to process the file further (to rename, move etc) you can use a second document management step with a command to handle that portion.

    --Bill

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 19, 2017 at 05:37 PM

    Bill,

    When I try to use a transaction, the Update Step never seems to be fired when I execute the transaction. I am using an Edit transaction instead of an Add.

    Here are some screenshots of my setup:

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      I was able to get this configuratoin working... the missing link was that I needed to do a transmit after the transaction.