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.

How to get complete path after uploading files.

No replies
Guest's picture
Guest

Hi,
I got one requirement,When user clicks on browse button,It upload files.right! But my requirement says,after uploading file i have to get not only file but complete path for the file.Once i click save button..it has to save complete path(path i have uploaded from server/local machines).

This is the code for my add attachment.

Local integer &iReturn;
Local integer &iRet;
Local string &sSysFileName, &sUserFileName;
Local string &Guid;

REM Prompt user to select a file from their folder structure;
REM and upload it to the TL_ACCT_CD_WRK table (our "file server");
&iReturn = AddAttachment(URL.TL_FILE_ATTACH, &sSysFileName, "", &sUserFileName, 0, False, MsgGetExplainText(13500, 159, ""));

PRCSRQSTDLG_WRK.LOADPRCSRQSTDLGPB.Enabled = False;

Evaluate &iReturn
When %Attachment_Success

Rem Validate file selection;
If Upper(Right(&sUserFileName, 4)) <> ".DAT" Then
Rem Clear uploaded file if format is invalid;
&iReturn = DeleteAttachment(URL.TL_FILE_ATTACH, &sUserFileName);
DERIVED_ADP_CHK.VIEWFILE_PB.Enabled = False;
DERIVED_ADP_CHK.VIEWFILE_PB.Label = DERIVED_ADP_CHK.VIEWFILE_PB.GetLongLabel("NOFILE");
MessageBox(%MsgStyle_OK, "", 13500, 163, "");
Else
Rem Enable viewing and processing the file;
ADP_RC_CHKNUM_U.ATTACHSYSFILENAME.Value = &sUserFileName;
REM TL_CF_RUNCTL.ATTACHSYSFILENAME.Value = &sUserFileName;
DERIVED_ADP_CHK.TL_SUBMIT_PB.Enabled = True;
DERIVED_ADP_CHK.VIEWFILE_PB.Enabled = True;
DERIVED_ADP_CHK.VIEWFILE_PB.Label = DERIVED_ADP_CHK.VIEWFILE_PB.GetShortLabel("VIEWFILE_PB") | ": " | &sUserFileName;

Post new comment

CAPTCHA
The question below is to prevent automated spam submissions.
3 + 4 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.