cancel
Showing results for 
Search instead for 
Did you mean: 

How to upload images from front end to backend in syclo?

sravanthi_polu
Contributor
0 Kudos

Hi experts,

Is there any possibility to upload images from front end to backend (non-sap(mssql)).I have tried with different possibilities,but either the path or binary format  has been stored but not the actual image.When i have taken the image field datatype as "Image" in frontend and backend, then binary format like"<Binary data>" is stored in the image field in backend. When the frontend and backend datatype is "string", then path of the image has been stored. In both the cases "edit type" at screen level is "image capture" .


Thanks in advance.

Regards,

Sravanthi Polu

Accepted Solutions (0)

Answers (1)

Answers (1)

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

Yes it is possible to upload images from the front end client to the backend.  The actual steps to store it will be dependent on what backend you are using.  The data will come from the clinet as a binary string or base 64 encoded string.

You didn't mention what kind of update step you are using to store the image (Java or SQL).  Either way your update step will need to properly format what is received from the client to store it in the format/method desired by the backend system.

Oftentimes, the actual image is stored on the filesystem and a reference to it is stored in the database rather than storing the actual image in the database table.

--Bill

sravanthi_polu
Contributor
0 Kudos

Bill,

Thanks for your reply. Iam using sql step to update to backend(mssql).Different datatypes that i have tried for image fields and their logs that i have found in "backendsql" file are as follows

        

Frontend          Back-end (mssql)           SqlLog                                                  MSSql Image

String               nvarchar(max)               C:\Users\Pictures\Sample Pictures\Dock.jpg Storingpath

                                                            (Updating Path)

Embedded          Image               Cannot evaluate flunky - << BinaryData>>                                 

          image                                         must supply another parameter

                                    

Embedded       nvarchar(max)      Cannot evaluate flunky -                     Cannot evaluate flunky -

Image                                     must supply another parameter          must supply another parameter

String               Image      C:\Users\Pictures\Sample Pictures\Dock.jpg        <<BinaryData>>

                                                 (Updating Path)

In all these cases at screen level i have used "edit type" for image field as image capture.I want to upload images from mobile to backend and also download images from backend to mobile device.

Is there any configurations to be done at server level.

Regards,

Sravanthi Polu

jason_latko
Advisor
Advisor
0 Kudos

Sravanthi,

You must use the "data" attribute of your image capture property to access the binary image data in your SQL Step.  If your image capture transaction property is called "Picture", you need to access the image flunky data this way:

"<<transaction.Picture.data>>"

You will need to expirement with Base64 encoding and decoding of this string depending on how/where to plan to store the data.

Jason Latko - Senior Product Developer at SAP

sravanthi_polu
Contributor
0 Kudos

Jason,

Thanks for your reply.I have uploaded images to agentry server as mentioned in the link

Agentry - Tutorials - SAP Mobility - SCN Wiki.

I have written a function to generate the "Image ID" automatically in backend mssql,transaction update steps(to capture the real "Image ID",file system update step(to update images to agentry server folder).Now the images are storing in agentry server with unique ID.But when i upload image to sql server it is storing only the path but not the image.

Regards,

Sravanthi Polu

jason_latko
Advisor
Advisor
0 Kudos

Sravanthi,

Whether you are using an external data property or an embedded image property in your transaction, you still need to reference the flunky's "data" attribute to retrieve the bytes in your sql script:

"<<transaction.Picture.data>>" for example, if your transaction's Embedded Image is named "Picture", or "<<transaction.Document.data>>", if your transaction's External Data is named "Document".

Jason Latko - Senior Product Developer at SAP