cancel
Showing results for 
Search instead for 
Did you mean: 

How to Download image

Former Member
0 Kudos

Hi All,

I done an application which consists of uploading and downloading an image. uploding is working properly but download is not working. can u please help me.

Thanks,

jyothi.

Accepted Solutions (1)

Accepted Solutions (1)

Qualiture
Active Contributor
0 Kudos

Are you using the IWDFileDownload UI element?

What problem do you run into?

Robin

Former Member
0 Kudos

Hi,

File download UI Element only. Am uploading the picture but it is invisible while downloading.

Thanks,

jyothi.

Qualiture
Active Contributor
0 Kudos

Hi,

What do you mean by 'invisible'?

When uploading, I assume you have stored the resource into the context?

In your FileDownload element, simply binding the the 'data' property to the resource context attribute should do...

Former Member
0 Kudos

Hi,

Uploaded image stored in the context with name picture "mydata.picture" this is binded to upload UI element.

ImgSource is the context element which is bound to picture.

public java.lang.String getMyDataImgSource(IPrivateDisplayMyData.IMyDataElement element)

{

//@@begin getMyDataImgSource(IPrivateDisplayMyData.IMyDataElement)

if(wdContext.currentImageElement().getDefault() == true)

{

return wdContext.currentMyDataElement().getAttributeAsText("PictureName");

}

else

{

return "images.jpg";

}

//@@end

}

Thanks,

Jyothi.

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Are you able to view the image uploaded ? Are you converting the image into bye array ?

Pls check this [link|http://wiki.sdn.sap.com/wiki/display/WDJava/BlobinWD] to store and retrieve images as BLOB images from Database..

Regards,

Vijay.

Former Member
0 Kudos

Hi,

Are you able to view the image uploaded ? Are you converting the image into bye array ?

Pls check this [link|http://wiki.sdn.sap.com/wiki/display/WDJava/BlobinWD] to store and retrieve images as BLOB images from Database..

Regards,

Vijay.

Former Member
0 Kudos

Hi Vijay,

Thankyou. I didn't work with database upto now. Where do we write the database code. can u please help me.

Thanks,

Jyothi.

Former Member
0 Kudos

Hi Jyothi,

Where are you uploading the image to ? (Some Oracle database / KM etc.. )

The link I shared earlier is having Oracle as database.

The link [Getting an image from KM Document to be used in Web DynPro|http://wiki.sdn.sap.com/wiki/display/KMC/GettinganimagefromKMDocumenttobeusedinWeb+DynPro] is when the image is stored in KM.

Also see this [Link|/thread/197461 [original link is broken]; which uses API to write and read the images.

Let me know where you are storing the image.

Regards,

Vijay.

Former Member
0 Kudos

Hi,

I dont no whether i am correct or not please let me know if i am wrong. Image am storing in context. Am doing example *"Developing Web Dynpro User Interfaces"*

Thanks,

Jyothi.

Former Member
0 Kudos

Hi Jyothi,

I don't think it is recommended to store the image in context.

When the Context is invalidated, the image will not be available again..

Better write the image in Byte array to KM and it can be read any number of times..

Regards,

Vijay.

Former Member
0 Kudos

Hi,

Are you able to view the image uploaded ? Are you converting the image into bye array ?

Pls check this [link|http://wiki.sdn.sap.com/wiki/display/WDJava/BlobinWD] to store and retrieve images as BLOB images from Database..

Regards,

Vijay.

junwu
Active Contributor
0 Kudos

can you share the code?

where you store the img?

how you access?

Former Member
0 Kudos

Hi,

Uploaded image stored in the context with name picture "mydata.picture" this is binded to upload UI element.

ImgSource is the context element which is bound to picture.

public java.lang.String getMyDataImgSource(IPrivateDisplayMyData.IMyDataElement element)

{

//@@begin getMyDataImgSource(IPrivateDisplayMyData.IMyDataElement)

if(wdContext.currentImageElement().getDefault() == true)

{

return wdContext.currentMyDataElement().getAttributeAsText("PictureName");

}

else

{

return "images.jpg";

}

//@@end

}

Thanks,

Jyothi.

Qualiture
Active Contributor
0 Kudos

Hi,

This is not correct.

You should bind the 'data' property of the FileDownload element (or, if you're on NW7.2, the 'resource' property) to your context node attribute of type IWDResource