Hi,
I would like to show PDF on webview element on a formview and would like to check if the target PDF exist or not before showing it.
However, it seems LRNG_CheckProperty doesn't accept URL like 'http://ext.lansa.jp/temp/sawada.pdf'.
Is there any way to achieve my requirement?
FYI:
[RPG](extracted)
D PDF_RESOURCE C 'http://ext.lansa.jp/temp/sawada.pdf'
If LRNG_CheckProperty(PDF_RESOURCE);
IsNewForm = False;
Endif;
[Error message when executing]
---------------------------------------------------------------
Error Code = 0. Character ':' is not allowed in property names.
Allowed in property names. Allowed characters are alphanumric and
underscore '_'.
Property name is not valid: 'HTTP'.
---------------------------------------------------------------
Best Regards,
Megumi Sawada
[RPG]LRNG_Checkproperty
-
MarkDuignan
- Posts: 346
- Joined: Wed Apr 18, 2012 10:33 am
Re: [RPG]LRNG_Checkproperty
In the LRNGCOMMON include member are a number of IFS file manipulation functions. I think this one might be the useful here:
Code: Select all
DLRNG_FileExists pr 10I 0 extproc('LRNG_fexists')
D FileName * value options(*String)
CheckFileName = ‘/MyFolderonIFS/Subfolder1/MyFile.pdf’;
If ( LRNG_FileExists(CheckFileName) = 1 );
// The file exists
Endif;-
MegumiSawada
- Posts: 268
- Joined: Tue Feb 19, 2013 5:18 pm
Re: [RPG]LRNG_Checkproperty
Hi Mark,
Thank you for your advice.
I think this LRNG_FileExists can check only on IFS(as same as LRNG_CheckProperty).
The PDF file is on the external web server. I would like to check if it exists before showing on a formview.
Do I need to assign this external web server to IFS directory?
Or is it not possible to check if the file exist on the external web server?
Best Regards,
Megumi
Thank you for your advice.
I think this LRNG_FileExists can check only on IFS(as same as LRNG_CheckProperty).
The PDF file is on the external web server. I would like to check if it exists before showing on a formview.
Do I need to assign this external web server to IFS directory?
Or is it not possible to check if the file exist on the external web server?
Best Regards,
Megumi
-
MarkDuignan
- Posts: 346
- Joined: Wed Apr 18, 2012 10:33 am
Re: [RPG]LRNG_Checkproperty
Yes, to make LRNG_FileExists work you would need to configure QNTC so that your IBM i based RPG program could access the network folder containing the PDF files on the web server. I have never done that but it seems in theory that would work.
http://www-01.ibm.com/support/docview.w ... s8N1021028
http://www-01.ibm.com/support/docview.w ... s8N1021028
-
MegumiSawada
- Posts: 268
- Joined: Tue Feb 19, 2013 5:18 pm
Re: [RPG]LRNG_Checkproperty
Hi Mark,
I See. I'll try.
Thank you for your advice!
Best Regards,
Megumi
I See. I'll try.
Thank you for your advice!
Best Regards,
Megumi