Skip to Content
Author's profile photo Sravanthi Polu

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.

/wp-content/uploads/2014/04/i1_435790.jpg

  • Set ‘Image ID’ property as key property.

/wp-content/uploads/2014/04/i1_435790.jpg

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

/wp-content/uploads/2014/04/i2_435801.jpg

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

/wp-content/uploads/2014/04/i3_435806.jpg

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

/wp-content/uploads/2014/04/i4_435807.jpg

  • 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

/wp-content/uploads/2014/04/i5_435815.jpg

  • Define a new File System Connection

/wp-content/uploads/2014/04/i6_435816.jpg

  • 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’.

/wp-content/uploads/2014/04/i7_435817.jpg

  • 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


/wp-content/uploads/2014/04/i13_435852.jpg

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

/wp-content/uploads/2014/04/i14_435853.jpg

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

/wp-content/uploads/2014/04/i8_435828.jpg

/wp-content/uploads/2014/04/i9_435829.jpg

/wp-content/uploads/2014/04/i10_435833.jpg

  • 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

/wp-content/uploads/2014/04/i11_435834.jpg

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

/wp-content/uploads/2014/04/i12_435835.jpg

  • Define Document mapping as shown

/wp-content/uploads/2014/04/i15_435854.jpg

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

/wp-content/uploads/2014/04/i16_435855.jpg

  • Define the following update steps to the add transaction

/wp-content/uploads/2014/04/i17_435856.jpg

  • 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

/wp-content/uploads/2014/04/i18_435863.jpg

  • Define an action with step type as transaction

/wp-content/uploads/2014/04/i19_435864.jpg

  • 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

/wp-content/uploads/2014/04/i20_435865.jpg

  • Add the buttons to the list screen of image object

/wp-content/uploads/2014/04/i21_435869.jpg

  • 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

/wp-content/uploads/2014/04/i23_435968.jpg

  • Publish to the agentry server and test  in ATE

/wp-content/uploads/2014/04/i24_435970.jpg

  • Click on ‘Upload Image’

/wp-content/uploads/2014/04/i25_435974.jpg

  • 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

/wp-content/uploads/2014/04/i26_435976.jpg

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

/wp-content/uploads/2014/04/i27_435996.jpg

  • Check the messages in transmit dialog box

/wp-content/uploads/2014/04/i28_436000.jpg

  • 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

/wp-content/uploads/2014/04/i29_436007.jpg

Back end table

/wp-content/uploads/2014/04/i30_436009.jpg

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

Assigned Tags

      18 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo sandeep aluri
      sandeep aluri

      Hi,

      What are the necessary backend sql tables are to be created for uploading images?and kindly please elobrate the mappings step.

      Author's profile photo Bill Froelich
      Bill Froelich

      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.

      --Bill

      Author's profile photo Former Member
      Former Member

      Sandeep,

      There is no necessary backend sql table, as this would be part of the schema where the images show should be saved.

      Author's profile photo sandeep aluri
      sandeep aluri

      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.

      Author's profile photo Sravanthi Polu
      Sravanthi Polu
      Blog Post Author

      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)

      Author's profile photo sandeep aluri
      sandeep aluri

      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.

      Author's profile photo sandeep aluri
      sandeep aluri

      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.

      [File-1]

      allowPreviousUserLogin=True

      enableAuthentication=False

      enablePreviousUserAuthentication=False

      name=File Back End

      pamServiceName=agentry

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

      userDomain=

      Kindly assist me on this..

      Author's profile photo Sravanthi Polu
      Sravanthi Polu
      Blog Post Author

      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

      Regards,

      Sravanthi Polu

      Author's profile photo sandeep aluri
      sandeep aluri

      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

      Author's profile photo Former Member
      Former Member

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

      To:tempPath=D:\agentry\serverdev\UploadedFilesTmp

      Pleas make sure to update the folder name.

      Stephen.

      Author's profile photo Sravanthi Polu
      Sravanthi Polu
      Blog Post Author

      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

      Picture1.png

      Regards,

      Sravanthi Polu

      Author's profile photo sandeep aluri
      sandeep aluri

      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

      Author's profile photo Bill Froelich
      Bill Froelich

      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.

      --Bill

      Author's profile photo sandeep aluri
      sandeep aluri

      Hi Bill,

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

      /wp-content/uploads/2014/06/f1_465765.jpg/wp-content/uploads/2014/06/f2_465766.jpg/wp-content/uploads/2014/06/f3_465767.jpg/wp-content/uploads/2014/06/f4_465768.jpg

      Author's profile photo Bill Froelich
      Bill Froelich

      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?

      --Bill

      Author's profile photo sandeep aluri
      sandeep aluri

      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.

      Author's profile photo Bill Froelich
      Bill Froelich

      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.

      --Bill

      Author's profile photo Bill Froelich
      Bill Froelich

      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.

      /wp-content/uploads/2014/05/uploadstep1_462497.png

      /wp-content/uploads/2014/05/uploadstep2_462498.png

      /wp-content/uploads/2014/05/uploadstep3_462499.png

      Hopefully this will help!

      --Bill