Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70440

File transfer java.security.cert.CertPathValidatorException

$
0
0

@B3nvo wrote:

hello,

I am trying to build file transfer into the app, but every time i try to upload a file i get greeted with

FileTransferError
   body: null
   code: 3
   exception: "java.security.cert.CertPathValidatorException: Trust anchor for certification path not found."
   http_status: null
   source: "file:///storage/emulated/0/Download/order69639758.pdf"
   target: "https://URL/link/to/api/attachments"

now for this testing i use the development branch and i link the URL to my pc. it works fine for all post and gets and it also works fine when updating for live.

The attachments on the other hand don’t work. There is no certificate on the android device and site.
would there by any chance be a solution for rooted android devices during development or do i have to create a certificate for this matter?
the android phone where i have been testing on is android 7.1.2 and i read that more people have trouble with android 7.

function

const fileTransferObject: FileTransferObject = this.fileTransfer.create();
        
        let trustAllHosts = true;

        let options: FileUploadOptions = {
            fileKey: 'file',
            fileName: '*.*',
            mimeType: 'multipart/form-data',
            headers: {'Content-Type': 'application/x-www-form-urlencoded'},
            params: {'user_id': this.data.User, 'token': this.data.Token, 'project_id': projects['project_id']}
        }
        
        fileTransferObject.upload(this.attach, 'https://URL/link/to/api/attachments', options, trustAllHosts)
        .then((data) => {
            console.log(data);
        }, (err) => {
            console.log(err);
        });

the URL is my ip4v for xampp

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70440

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>