Pdf document to php server


#1

hi guys anyone having experiences in upload the pdf document from ionic to php server…


#2
 let options: FileUploadOptions = {
     fileKey: 'file',
     fileName: 'anyname',
     headers: {}
  }


 fileTransfer.upload('<file path>', http://aip.upload.php', options)
   .then((data) => {
     // success
   }, (err) => {
     // error
   })
}


#3

Depending on the size you also have the option of uploading the document as a base 64 string which makes it easier in terms of CORS type issues.

Then it’s just a case of receiving a JSON payload.