- Steve Mason
- PowerServer Mobile (Obsolete)
- Tuesday, 5 December 2017 10:41 PM UTC
I am attempting to save and display a pdf file in a mobile app using the following code. of_loadlocalfile returns -1 and the code displays the following message:
loadlocalfile error: "rc: -1 file: /var/mobile/Containers/Data/Application/7BC99...490/Documents/17574048/plugin/Leads.pdf error:"
What am I doing wrong?
////////////////////////////////////////////////////////////////////////////////////////////////
int li_rc
string ls_filename = 'Leads.pdf'
string ls_filepath
eon_mobile_webviewex luo_webview
li_rc = dw_prospect_admin.saveas(ls_filename, PDF!, true)
if li_rc 1 then
messagebox('saveas error', 'rc: ' + string(li_rc))
return
end if
if gs_clienttype = 'MOBILE' THEN
ls_filepath = appeongetcachedir() + '/plugin/' + ls_filename
if not fileexists(ls_filepath) then
messagebox('file does not exist', ' file: ' + ls_filepath)
return
end if
luo_webview = create eon_mobile_webviewex
li_rc = luo_webview.of_loadlocalfile (ls_filepath)
if li_rc = 1 then
messagebox('loadlocalfile success', 'file: ' + ls_filepath)
else
messagebox('loadlocalfile error', 'rc: ' + string(li_rc) + ' file: ' + ls_filepath + ' error: ' + luo_webview.is_errortext)
end if
destroy luo_webview
end if
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.