Skip to content
This repository has been archived by the owner on Dec 29, 2024. It is now read-only.

File Transfer in Ionic 3 using Ionic Native's File and Transfer modules 📁

License

Notifications You must be signed in to change notification settings

dsgriffin/ionic-3-file-transfer-example

Repository files navigation

Ionic 3 File Transfer Example 📁

A simple file transfer example in Ionic 3 using Ionic Native's

  • Transfer module to download a file to the local device
  • And then, using the File module, retrieve that file

Requirements

  • File Transfer will not work on an emulator; you'll need an iOS or Android device
  • If you're building/testing for/on iOS, you'll need XCode.

Build

Clone the repository and follow the steps based on the platform of your device.

iOS

  1. npm install
  2. cordova platform add ios
  3. ionic cordova build ios
  4. Connect your iOS device and run the application, either by
  5. Opening up the relevant .xcodeproj on Xcode and clicking the run button (making sure your device is selected)
  6. Running ionic cordova run ios --device on your CLI - this requires that the npm package ios-deploy is installed globally (npm install -g ios-deploy)

Android

  1. npm install
  2. cordova platform add android
  3. ionic cordova build android
  4. Connect your Android device and run the application with ionic cordova run android (make sure USB debugging is enabled on your device)

File Transfer - Storage Locations

The .jpg used in this example is saved in different locations dependant on platform:

  • iOS - in the app-specific Documents/ folder using cordova.file.documentsDirectory

  • Android - persistent and private data storage within the application's sandbox using cordova.file.dataDirectory

Here's the list of the different places you can store files using this plugin.

Contributing

If you've found a bug or have an idea, feel free to open an Issue. If you've got a fix or feature ready, open a PR. Thanks!

License

MIT

About

File Transfer in Ionic 3 using Ionic Native's File and Transfer modules 📁

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published