on 02-24-2006 12:48 PM
Hai All,
I am working in web Dynpro2.0.9 with Java.For file upload and download "IWDResource" is used.But this package is not available in web Dynpro2.0.9.How to download and upload files through using this version?
Anyone can help me?
Thanks in Advance,
Kindly Regards,
S.V.Selva Bala.
http://help.sap.com/saphelp_nw04/helpdata/en/5a/90ff4cd0c8cd48a69b836e5e550880/content.htm
Please refer this link.
Regards,
Noufal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai Noufal,
I successfully upload the files to the database.
For file download i create two views.
In the first view files are fetched from the database(datatype for the file is image in the database)and it is converted to byte from image.Afterthat the byte is converted to string by using the following code.
byte source[]=new byte[1024];
if(rs.next()){
source=rs.getBytes("cv_document_file");
}
String sourcestr=source.toString();
wdContext.currentContextElement().setDownloadfile(sourcestr);
Now i put the converted string into the second view.In the second view i try to convert the string value into bytes by using the following codes.
String sourcestr=wdContext.currentContextElement().getDownloadfile();
byte bs[]=new byte[1024];
bs=sourcestr.getBytes();
wdContext.currentDownloadElement().setDownloadfile(bs);
But it doesn't work and no error.
Now i am expecting the valuable suggestions from you.
Thanks in Advance,
Kind Regards,
S.V.Selva Bala.
Hai Noufal,
For file storage in database,the datatype given for me is "BLOB".I am using MSSQL.
Now i am using "Image"as the datatype for to store the files.I studied that BLOB,CLOB are possible in Oracle only.In MSSQL ntext,image are used as a data type for file storage.Is any possibility to store files as "BLOB" in MSSQL database.If it is not possible among the ntext,image which one is possible and what is the reason why BLOB is not used in MSSQL.I need valuable suggestion and very soon reply from you.
Thanks in advance,
Kind Regards,
S.V.Selva Bala.
Hai Noufal,
With your help i successfully upload the files by using web Dynpro2.0.9. with Java.
But now also i am having the problem in down load the files.
In web Dynpro 2.0.9 "IWDResource" is not possible.
What is the alternative way to over come this problem.
I expect valuable suggestions from you.
Thanks in Advance,
Kind Regards,
S.V.Selva Bala.
Hi,
please refer to the sample file upload/download code provided in the link below.
Regards,
S.Divakar
Hi Bala,
I can't understand why you are converting the the bytes to String and then String to Bytes...
You can convert the image to bytes and store it in a binary attribute and map it to the other view through the controller and will be available in the second view.
In the wdDoInit() of the where you have the download element-
write the following code
IWDAtrributeInfo info=wdContext.getNodeInfo().getAttribute(<attribute name>);
IWDModifiableBinaryType binary=(IWDModifiableBinaryType)info.getModifiableSimpleType();
binary.setMimeType(WDWebResourceType.JPG_IMAGE);
Regards,
NOufal
Hi Noufal,
1.I have crated a attribute in binary data type.
2. Bind it to the FileDownload UIElement's data property.
3.From the database the image is selected as binary and set the value to the attribute.
4.while execute it i couldn't receive any image.
My requirement is load the client's photo from database table. Is has been stored as binary image in MS SQL server
Is it the right way?
how can I got the image at the screen?
Is any other UIElements available to solve it?
Kind Regards.
Selva Bala.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.