1. Winston Bautista
  2. PowerServer Mobile (Obsolete)
  3. Wednesday, 11 September 2019 06:35 AM UTC

I am using fileservice for powerserver by uploading PDF files.   The pdf file is only working in IOS devices and Android devices show 0 bytes.  Can anyone help?

Attachments (1)
Winston Bautista Accepted Answer Pending Moderation
  1. Thursday, 12 September 2019 05:45 AM UTC
  2. PowerServer Mobile (Obsolete)
  3. # 1

Dear Chris,

Thank you for your reply….

What version of Android are you using?

                Android Version 9


What version of PowerServer are you using?

Appeon Powerserver 2019 Build 1988.00

 


What version of AWS are you using?

64 Bit and Comes with the Powerserver


Can you show us your File Upload code?

 

Code….

 

 

eon_mobile_awsex lnv_aws

eon_mobile_str_mailcontent lstr_content

 

AppeonFileService fileservice

fileservice = create AppeonFileService

 

 

long                       ll_count

string     ls_recipient[]

string     ls_cc[]

string     ls_bcc[]

string     ls_attachmentfile[]

integer li_re

string    ls_file, ls_filename

 

 

 

String    ls_filepath

Integer li_return

String    ls_Object

String    ls_url

String    ls_customer_email

String    ls_cc_email

String    ls_sales_person_email

String    ls_supervisor_email

String    ls_manager_email

String    ls_one_plus_one_email

 

 

long ll_re

string info

 

sTring  ls_os_type

 

ls_os_type = upper(left(AppeonGetOSType ( ),3))

 

 

select    ISNULL(email,'')

into                        :ls_customer_email

from                      vw_customer_list            a              with       (nolock),

                                                MOB_SALES_RETURN    b             with       (nolock)

where  a.CUSTOMER_CODE                       = b.CUSTOMER_CODE

and                        REF_NO                                                                                               = :is_ref_no;

 

 

select                    isnull(( select email from sales_person_email      where sales_person_id = a.SALES_PERSON_ID),'oneplusone@lifco-international.com')  ,

                                                isnull(( select email from supervisor_email                           where supervisor_code = b.supervisor_code),'oneplusone@lifco-international.com')  ,

                                                isnull(( select email from manager_email                                              where manager_code                   = b.manager_code),'oneplusone@lifco-international.com')          ,

                                                'oneplusone@lifco-international.com'

into                         :ls_sales_person_email

                                                ,:ls_supervisor_email

                                                ,:ls_manager_email

                                                ,:ls_one_plus_one_email

from                      mob_sales_return                           a,

                                                sales_person                                     b

where   a.SALES_PERSON_ID                      = b.SALES_PERSON_ID  

and                        ref_no                                                                                  = :is_ref_no;

 

 

 

//if not (isnull(sle_email.text) or sle_email.text = '' ) then

//            ls_customer_email = sle_email.text

//end if

//

 

 

lnv_aws = create eon_mobile_awsex

lstr_content.s_subject                  = sle_subject.text

lstr_content.s_notetext                = sle_body.text

ls_recipient[1]                                                   =  sle_email.text                              // Customer

ls_cc[1]                                                                                                 = ls_one_plus_one_email

 

 

if  not(  isnull(ls_sales_person_email) or ls_sales_person_email = '') then

                ls_cc[2]  = ls_sales_person_email

end if    

 

 

if  not(  isnull(ls_supervisor_email) or ls_supervisor_email = '') then

                ls_cc[3]  = ls_supervisor_email

end if

 

 

if  not(  isnull(ls_manager_email) or ls_manager_email = '') then

                ls_cc[4]  = ls_manager_email

end if

 

 

if ls_os_type = 'IOS' THEN

               

                ls_file = 'mail.pdf'

                dw_1.saveas( 'mail.pdf', PDF!, True)

               

                ls_file = is_ref_no+".pdf"

                dw_1.saveas(ls_file, PDF!, True)

else       

               

                ls_file = 'mail.pdf'

                dw_1.saveas( 'mail.pdf', PDF!, True)

               

                ls_file = is_ref_no+".pdf"

                dw_1.saveas(ls_file, PDF!, True)

End if

 

 

if ls_os_type = 'IOS' then

                ls_attachmentfile[1] = appeongetcachedir() + "/plugin/mail.pdf"

                //ls_attachmentfile[1] = appeongetcachedir() + "/plugin/"+ls_file

else

                ls_attachmentfile[1] = appeongetcachedir() + "/plugin/"+ls_file

end if    

 

li_re = lnv_aws.of_sendmail (lstr_content, ls_recipient, ls_cc, ls_bcc, ls_attachmentfile)

 

// Upload file to server

 

 

Messagebox("Success","Email Sent..")

 

 

                     ls_filepath =ls_file

 

                                ll_re = fileservice.of_logonfileserver ("94.200.118.98", 8081, "username=lifco;password=lifco")

                               

                                if ll_re = 0 then

                                info = "Logon to file server is successful."

                                elseif  ll_re = 1 then

                                info = "Failed to connect to the file server."

                                Messagebox( "ll_re="+string(ll_re),info)

                                return

                                else

                                info = "Failed to connect to the file server."

                                Messagebox( "ll_re="+string(ll_re),info)

                                return

                                end if

                               

                   //  ls_url = fileservice.of_appeonupload (ls_attachmentfile[1],"upload",true, ll_re)

                                 

                                if ls_os_type = 'IOS' THEN

                                                ls_url = fileservice.of_appeonupload (ls_filepath,"upload",true, ll_re)

                                               

                                               

                                else

                                               

                                               

                                                //ls_filename = appeongetcachedir() +ls_file

                                               

                                                // ls_url = fileservice.of_appeonupload (ls_filepath,"upload",true, ll_re)                                                                 // blank pdf

                                               

                                                //ls_url = fileservice.of_appeonupload (  ls_attachmentfile[1] ,"upload",true, ll_re)    // blank pdf

                                               

                                                                ls_filename =ls_file

                                                                ls_url = fileservice.of_appeonupload (  ls_filename  ,"upload",true, ll_re)                                                                                // blank pdf

                                               

                                                 

                                end if    

                                  

                                                update mob_sales_return

                                                  set pdf_file = :ls_url

                                                  where ref_no = :is_ref_no;

                                                  commit;

                               

                                                               

                                if ll_re = 0 then

                                info = "Upload is successful."

                                elseif  ll_re = 1 then

                                info = "Failed to upload the file."

                                else

                                info = "Other errors."

                                end if

                               

                               

                                if ll_re = 0 then

                                                Messagebox("Success","PDF File Uploaded")

                                end if    

                               

                               

                                ll_re = fileservice.of_logofffileserver ( )

                               

                                destroy fileservice

                                close(w_one_plus_one)

                                close(parent)

 

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 11 September 2019 14:54 PM UTC
  2. PowerServer Mobile (Obsolete)
  3. # 2

Hi Winston;

    Can you tell us ...

  1. What version of Android are you using?
  2. What version of PowerServer are you using?
  3. What version of AWS are you using?
  4. Can you show us your File Upload code?

Regards ... Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.