1.0.1 • Published 3 years ago

filepond-plugin-copy-path v1.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
3 years ago

filepond-plugin-copy-path

License: MIT npm version

This is a simple plugin of FilePond that adds button which copy uploaded file path(URL) at clipboard.

Quick Start

Install using npm:

npm install filepond-plugin-copy-path

Then import in your project:

import * as FilePond from "filepond";
import FilePondPluginCopyPath from "filepond-plugin-copy-path";

Or reference it by CDN

<script src="https://unpkg.com/filepond-plugin-copy-path/dist/filepond-plugin-copy-path.min.js"></script>

Register the plugin:

FilePond.registerPlugin(FilePondPluginCopyPath);

Create a new FilePond instance as normal.

const pond = FilePond.create({
  name: "filepond",
});

// Add it to the DOM
document.body.appendChild(pond.element);

The functionality will become active after uploading a file.

Change the defaults

If you want you can change the defaults for this plugin

in the javascript

pond.setOptions({
    server: { // This plugin uses server option and serverID of file to get path.
        url: 'http://127.0.0.1:8080',
        load: '/custom_load_path/'
    }
    labelButtonCopyPath: 'Custom label', // by default 'Copy uploaded file path'
    copyRelativePath: true, // by default false
    alertCopyPath: true // by default false
 });

View the demo