Better Programming

Advice for programmers.

Follow publication

Member-only story

How to Upload Files in Ionic/Angular Apps

Sergey Rudenko
Better Programming
Published in
2 min readFeb 29, 2020

--

Photo by Kelli McClintock on Unsplash

When it comes to working with the device’s file system, the choice of the approach often depends on your use case.

For example, if you need the ability to “write” to the user’s file system, you definitely want to leverage an approach that has valid user permissions to do so and for Ionic apps, it will mean the Cordova or Capacitor plugin and valid permissions set for it to request access to the user’s file system.

There are at least six plugins listed on the Ionic framework website to choose from. Which one really suits your needs?

https://www.ionicframework.com

In practice, very often we just need the “read” access to the file system of our user and allow them to upload their files (such as images).

In this specific use case, we can rely on web standards and leverage the browser’s File Reader API, which gained fairly good support across all modern browsers lately.

Template Code

--

--

Sergey Rudenko
Sergey Rudenko

Written by Sergey Rudenko

Tech enthusiast and product leader (Amazon PM Tech, ex Riot Games, ex Microsoft, Nokia), author of something awesome in the future;)

Write a response