You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

peoplecode help

2 replies [Last post]
vrs_11's picture
User offline. Last seen 12 years 43 weeks ago. Offline
Joined: 06/02/2008
Posts: 4

hi all,
i was given an assignment..in coding i have a problem.
let me share what assignment i need to do with u all.
there is a run control page which has only a file name (to be displayed) and a browse button.
when the browse button is clicked it should open a dialog box which should only accept .CSV files as input & on clicking it, it(file name) should appear in the file name edit box.

1) do i have to use addattachment function here ?
2) how to make that file displayed in filename(edit box) ?

anybody having a sample code for this ?

CompShack's picture
User offline. Last seen 6 years 28 weeks ago. Offline
Joined: 12/09/2007
Posts: 167
Re: peoplecode help

Yes you will have to use the AddAttachment function.
You need to call the function as such:

&retcode = AddAttachment(URL.MYFTP, &ATTACHSYSFILENAME, &FILEEXTENSION, &ATTACHUSERFILE, 0);

After this function executes successfully you can take the ATTACHUSERFILE value and assign it to the field on your page. ATTACHSYSFILENAME and ATTACHUSERFILE could have the same file name. The 1st is the path and file name on the source machine and the 2nd is the file name the way you want it to arrive to the target machine.

Take a look at the example addattachment code in PeopleBooks, you can literally take that code and modify it a little bit to make it work according to your needs.

Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog

vrs_11's picture
User offline. Last seen 12 years 43 weeks ago. Offline
Joined: 06/02/2008
Posts: 4
Re: peoplecode help

I am really really thankful to you . i ll do the same way ..thanx once again