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

Local files on IOS device : can write but not read any file

$
0
0

@apalau wrote:

Hi there,

I used the cordova-plugin-file-transfer plugin to download files to local system.

I selected the cordova.file.dataDirectory option to store my files.

No problem for downloading, I could write into the local system and check their existing through this command

this.file.resolveLocalFilesystemUrl(cordova.file.dataDirectory + 'myIMG.jpg').then(
                        (files) => {
                            console.log('IMG file found : ' + files.toURL());
                        }
                    ).catch(
                        (err) => {
                            console.log('IMG file not found');
                        }
                    );

But when I try to access the files, for example to display an image downloaded in the local filesystem, my IOS device does not show any image.

The files.toURL() correctly returns : file:///var/mobile/Containers/Data/Application/XXXXXXXX/Library/NoCloud/myIMG.jpg
Looking to the container shows that the files are inside.

Even this command gives an empty image :
<img src="file:///var/mobile/Containers/Data/Application/XXXXXXXX/Library/NoCloud/myIMG.jpg"/>

Any help please ? Cannot understand why I can write but no read a downloaded file to the local system.

Thanks

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>