save-blob-component
v0.0.18
Published
Simple File Downloader
Downloads
6
Readme
Save Blob
A simple blob saver. This discription is under construction.
Installation
Just place the following line somewere in your index.html:
<script src='https://unpkg.com/[email protected]/dist/saveblobcomponent.js'></script>
Angular/Ionic Framework
You should import CUSTOM_ELEMENTS_SCHEMA in your app.module.ts file:
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
Usage
Then in your page markup file (i.e. my-page.html, or contacts.html or whatever markup file you need) call to component like this:
<file-downloader url="http://example.com/some-image.jpg" fileName="some image" opts="{method:'get', headers: [{'Access-Control-Allow-Origin':'*'}]}"></file-downloader>
Parameters: * url: an url you want to download file from * fileName: the name of a file. File will be placed to your specified location with this name * opts: request options such as method and request headers. You can provide authentication information like access token if needed
Simpliest form (without options) is:
<file-downloader url="http://example.com/some-image.jpg" fileName="some image"></file-downloader>
To be continued