Skip to Content

Uploading images to agentry server

This document explains a simple example to upload images to agentry server folder.

  • Create an object named ‘Image1’  at module level.
  • Add two fields ‘Image ID’ with data type as ‘String’ and ‘Image Field’ with data type as ‘External Data’ property.


  • Set ‘Image ID’ property as key property.


  • Add ‘Image1’ Object to the collection property of main object.


  • Define an Add transaction for the ‘Image 1’ object with ‘Image ID’ and ‘Image Field’ as transaction properties.


  • Set the Key Property of the transaction to ‘Image ID’


  • Select the ‘Image ID’ transaction property in the properties view.Select Initial Value to ‘Rule-Before Data Entry’.Add a new rule as shown to locally store the Images uniquely on the mobile device


  • Define a new File System Connection


  • Create the required tables at MS Sql backend ‘Syclo Image IDX ref’ with ‘Local ID’, ‘Real ID’,’User ID’,’Server ID’ fields .Define a function to generate ‘Image ID’s’.


  • Create two folders ‘Uploaded Files’ and ‘Uploaded Files Tmp’ in the server root folder
  • Define a string global type with value set to the path of the folder created in agentry server


  • Define another global to set the format of the image to ‘.JPEG’


  • Define SQL steps ‘Get Real Image ID’, ‘Insert Image IDX ref’,’Insert Image Upload’ with following code




  • Add a step with step type as ‘File Document Management’,select the system connection as ‘FileSystem via FileSystem’.Click on next and fill the attributes as shown and finish the wizard


  • Make sure that the delete script file check box is unchecked,if not the .bat files generated will be deleted automatically


  • Define Document mapping as shown


  • Select Document Management Script, and define the script as follows and save


  • Define the following update steps to the add transaction


  • Design a screen set for the image object with a list screen
  • Design a screen set for add image transaction.Set the Image Field edit type to image capture
  • Define an action with step type as navigation to switch the screen to image list screen


  • Define an action with step type as transaction


  • Define a detail screen in the main screen set.Add a field with type as button.Set the width,size and other attributes according to the requirements.Map the actions as shown in the screen shot


  • Add the buttons to the list screen of image object


  • Define styles and map to the screen fields type according to the requirements
  • Publish the application to agentry server,a prompt to modify the agentry.ini file will be displayed.
  • Set the temp path in agentry.ini file for file system connection as follows.All the batch files will be stored in this temp path.Save the file and restart the agentry server once the modifications are done


  • Publish to the agentry server and test  in ATE


  • Click on ‘Upload Image’


  • Click on Add Image button number of images to be uploaded to agentry server.Click on image capture icon to select the images from local device


  • Iam adding four images to upload in to agentry server .


  • Check the messages in transmit dialog box


  • Check whether the images are uploaded to agentry server ‘Uploaded Files’ folder,check the files in ‘Uploaded Files Tmp’ folder and also the image id is stored at the backend table


Back end table


Note:Similarly we can even upload documents to agentry server,just try to create the another object and follow the above steps by making necessary changes to meet object names,screen sets etc….

Hope this may be helpful

You must be Logged on to comment or reply to a post.
    • Sandeep,

      The database table is simply storing the image ID reference in this example.  The article is focused on the process to upload images from the client to the server.

      In this example the database table is just an ID table with an auto-generated id value.  In a real example you would probably be attaching a reference to something else in your database.  Since this example isn’t linking the image to anything there really isn’t any mapping steps.

      The only step is really the basic insert into the ID table.


  • Hi,

    I have followed the above steps and tried to upload the images,But the images are not storing in the “Uploaded Files” folder..which i have created in agentry server folder..Kindly assist me in how to use the “file system document management step.” in the above article.

    • Sandeep,

      Can you please post  the ‘File system log’ ,so that it would be easy to track the issue.Once check the .bat files in ‘Uploaded files tmp’ folder(open with notepad and check whether the respective values are replacing)

      • Hi sravanthi,

        The .bat files are not storing in ‘uploaded files tmp’. The files are directly saving in the agentry server folder.I have checked the file but the is not having any path where the fle is saving.Please help me on this.

      • Hi Sravanthi,

        The .bat files are saving in the below path

        D:\agentry\serverdev\Application\Development\Scripts. But i have created the folder ‘uploaded files tmp’. and the file is having only below values.

        @echo off

        echo test.  In agentry.ini file i have given below values.





        name=File Back End


        tempPath=D:\agentry\serverdev\Uploaded Files Tmp


        Kindly assist me on this..

        • Sandeep,

                    Enable BackEnd-File-2 logs,if possible post the log.These logs can be enabled in agentry administration client


                    It seems that you have not written any code in step.Copy the .bat file in this example uploadimages11.bat and  search it in agentry server folder,once you found the file,right click,edit and write the copy command found in the document and save.Restart and publish the changes to server.Now check the ‘uploaded files’ and ‘uploaded files tmp’ folder in agentry server


          Sravanthi Polu

          • Hi srvanthi,

            I have edited the .bat files in agentry server folder and published the changes.But still i am not able to upload the files..Please find the below screen shots and kindly assist me. bat file.jpg/wp-content/uploads/2014/05/script_463327.jpg

          • For your temp path can you use a one without spaces
            tempPath=D:\agentry\serverdev\Uploaded Files Tmp


            Pleas make sure to update the folder name.


          • Sandeep,


                 Make sure you have enough permissions to write.First try to execute the commands in command prompt.Make the below screen shot as your reference



            Sravanthi Polu

          • Hi Sravanthi,

            I have installed Agentry sever in following path D:\agentry\serverdev\uploadedfiles.When i am trying to execute the above command i am getting “The system cananot find the path specified. if i am trying to execute with D:\agentry\serverdev\uploadedfiles path i am getting same error.Kindly assist on this./wp-content/uploads/2014/05/path2_463905.jpg/wp-content/uploads/2014/05/path_463904.jpg

          • Sandeep,

            I am confused as to where things are currently installed / expected to be found based on your screen shots.

            Is the Agentry server in C:\Syclo-NonSAP\ServerDev or D:\agentry\ServerDev?

            Also can you share your document management steps setting similar to my screen shots?

            And lastly do you have the File backend logging enabled at the lowest level that you can also share?

            Looking at your screen shots I can’t tell if your bat file is being used or setup correctly.  We may need to look at your application definitions in more detail to confirm global settings,etc.


          • Hi Bill,

            I have installed my agentry server in “D:\agentry\serverdev”. Please find below screen shots for my document management step.


          • Sandeep,

            The files will get uploaded to the UploadedFiles directory by the client but what are you trying to do with them after they get to the Agentry server?

            This is where your File System Document Management Step comes into play.  I can’t tell from your screen shot what the upload.bat file is doing.  Can you elaborate?


          • Hi Bill,

            I have followed above document to upload images from my desktop local drive to agentry sever. as in above procedure i created a folder named “uploadedfiles” and  i am tryingto uploaded files from my local drive but these files are not uploading to agentry sever.

          • Can you show me the transaction where you attach the file from your client?  or send me an export of your application (direct mail?) so I can look at the transaction.


    • There is nothing special in that step.  You need to define the upload step and attach it as the Update step on the transaction where you are adding the image on the client.

      Here are some screen shots for one of my upload steps.




      Hopefully this will help!