cancel
Showing results for 
Search instead for 
Did you mean: 

How to display the uploaded file

Former Member
0 Kudos

Hi All ,

I have the below requirement .

1. Upload the file (any file type) -- no problem done with FileUpload UI element.

2. Display the uploaded file as icon or link .

3. User should be able to delete the uploaded file using icon or link (depends upon step2 ).

I am struggling with step2 and 3 .

Please guide me

Regards,

Ravi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can use the file download UI element for your requirment. You will have the Resource type context that is used to bind the File upload UI element. bind the same context to the file download UI element. And hence without any extra coding your requirment is achieved.

For deleting the Uploaded file delete the context element of type reource.

For your reference refer to the following link

http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/202a850a-58e0-2910-eeb3-bfc3e0812...

Regards,

Raju Bonagiri

Former Member
0 Kudos

Hi Raju ,

Thanks for the reply ...

I want to display the uploaded file and also user should be able to delete this uploaded file if he has uploaded

the wrong file by mistake and should be able to upload the other file .

Can you please guid me to achieve this ?

Regards,

Ravi

patrik_spiess
Participant
0 Kudos

Hello Raju,

what do you mean with "delete the context element of type reource". The file will not be deleted physically on the server, I guess. I want to physically delete the file.

Regards,

Patrik

Former Member
0 Kudos

Hi Patrik

1. Where do you store this file?

2. If this file is saved on a certain file system, you can easily delete this file using the File class,
    provided of course you hold the full path to this file.

3. Try

File f=new File("path");

if(f.exists() && f.isFile()){

f.delete();

}

regards

Yuval

Answers (1)

Answers (1)

former_member187439
Active Participant
0 Kudos

Hi Guys,

It all depends on which server your files are stored.

For example, if its R3, then you must use a function module which will take the document and also return the document to your WebDynpro Java application. The data type in backend should be "xstring" to which you have to pass your document. You should convert the document into xml format before setting the value to the R3 field. The logic of displaying an already stored document and deleting it from the server should be handled in the ABAP function module.

Regards

Kavitha.