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

Getting error while using this.file.externalRootDirectory

$
0
0

@tejakumar wrote:

Hello all,

I am facing an issue while copying file form assets folder to externalRootDirectory. Its showing error like Not_Found. When i change externalRootDirectory to dataDirectory it is working fine.

/* ********************************************************* */
/*                   Below Code is working fine              */
/* ********************************************************* */

const path = this.file.applicationDirectory + 'www/assets/';
		this.file.copyFile(path, 'mypdf.pdf', this.file.dataDirectory, 'mypdf.pdf').then(
			(fileCopyResp: any) => {
				console.log(fileCopyResp);
			},
			err => {
				console.log('Error over file copy:::\n', err);
			}
		);
/* ********************************************************* */
/*                   Below Code is not working               */
/* ********************************************************* */

const path = this.file.applicationDirectory + 'www/assets/';
		this.file.copyFile(path, 'mypdf.pdf', this.file.externalRootDirectory, 'mypdf.pdf').then(
			(fileCopyResp: any) => {
				console.log(fileCopyResp);
			},
			err => {
				console.log('Error over file copy:::\n', err);
			}
		);

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70435

Trending Articles



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