GithubHelp home page GithubHelp logo

wn-forumupload-plugin's Introduction

Forum Upload

This plugin extends Winter.Forum to adds front-end user file upload capabilities to it.

It extends the Topic component to add a onFileUpload handler which:

  • store the uploaded files
  • attach them to the Post model

File upload Preview

Under development

This plugin is still under active development and should not be used in a production environment.

Installation

This plugin can be installed using composer:

composer require sunlab/wn-levelup-plugin

How to use it

The plugin doesn't provide any front end component, you need to customize yourself the way the file should be attached on the frontend side, you can use it with Dropzone.js, a richeditor or any custom implementation.

You can find here a custom implementation reproducing a GitHub-like mechanism (as shown above).

Basically: you need to trigger an AJAX call for the handler onFileUpload sending files (the input name doesn't matter). The handler will return server-side uploaded files' information containing:

    id => the File model id
    originalName => the uploaded original file name
    name => same as originalName without extension
    url => the server-side file's url

Settings

The plugin includes a Settings model to validate uploads, including:

  • The allowed file extensions
  • A max filesize limit
  • The amount of files per post

Todo:

  • Add a onFileDeletion handler to remove an attached file

wn-forumupload-plugin's People

Contributors

romainmazb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.