cancel
Showing results for 
Search instead for 
Did you mean: 

Implementing File Upload component + Java Mail

chintan_virani
Active Contributor
0 Kudos

Guys,

Brief Intro : I have a form with some input fields. Upon submission of the form all the necessary information is submitted ro R/3 system and a mail is send to lets say administrators. I have Java Mail program for sending emails.

My requirement : I want the users to give the FileUpload option in the form so that they can select the file and that file should be attached to email whcih I am sending upon form submission.

Questions:

1) How to check the path of the file where it gets uploaded.

2) Does it get uploaded on the Server where I deploy my application.

3) Any Solution/suggestion on how to implement the requirement stated above.

Regards,

<b>Chintan Virani.</b>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Chintan,

Hope this url will help you in getting the file path:

Regards,

Rajeev

chintan_virani
Active Contributor
0 Kudos

Rajeev,

Thanks for the information but I do not get the UIElementType "Resource" as mentioned in that topic.

<b>- Chintan Virani.</b>

Former Member
0 Kudos

Hi Chintan,

Resource is used as a type of the context attribute created:Just copy the path given below in the attribute property ->value

com.sap.ide.webdynpro.uielementdefinitions.Resource

regards,

Rajeev

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Chintan...

File Uplaod UI Element is just to get the file path of the file from the client or presentation server i.e. our pc. Rest code to store the data is done in action of the upload button (not the browse button). So no file is formed automatically.

Unless you write the code to read the file from the path selected, you cannot get the data bytes and unless you mention the path no file is made in the server.

Better would be that you keep a file template in the mimes folder and at runtime you write to this file.

The path of the file in the mimes folder is

temp
webdynpro
web
local
<ProjectName>
Components
<Component Package>
<File Name>

This file can be attached to your mail as an attachement.

Further reference...

Regards,

Mahesh K.

chintan_virani
Active Contributor
0 Kudos

Mahesh,

Thanks for the information.

Rajeev,

If I paste the value you mentioned it resets back to older value.

Former Member
0 Kudos

Hi Chintan,

Go to the property of context attribute.

click on the selection for the property "type" in the right side.

A pop for type selection will appear.

Click on simple type,then expand Dictionaries->Local Dictionary->com.sap.ide.webdynpro.uielementdefinitions

Find resourse in the tree structure and then select it.

Regards,

Rajeev

chintan_virani
Active Contributor
0 Kudos

Rajeev,

I am familiar with the step u have elaborated. But the problem is I do not have Resource as one of the options there. Maybe because I am using NWDS 2.0.9 ?

<b>- Chintan Virani</b>

Former Member
0 Kudos

Hi,

Upload UI element is for selecting the file to be uploaded and the data gets stored in the context attribute( normaly it will be binary type ) which is binded to the source of the UI elment.

Using this data if you create any file, it will get stored in the file path given you in the server.

Regards,

Mahesh K.

chintan_virani
Active Contributor
0 Kudos

Mahesh,

I already know the step you have mentioned for File upload component.

I have not mentioned any path in my program for Files to get uploaded. So in case you know where does it get stored by default please let me know and how to select that file and attach to the email program.