Giter VIP home page Giter VIP logo

download-all-attachments's Introduction

Module - Download All Attachments

This Extension allows to download all the attachments from a multiple attachment field compressed as a Zip or individually.

Table of Contents

Introduction

This extension adds two features to the Attachment Multiple field in EspoCRM:

  • display the button on every attachment multiple field.
  • Display the button in the stream panel if attachments are found.

Choose Between 3 different modes:

  • Single Mode: Downloads each attachment one by one.
  • Zip Mode: Downloads a single archive with all the attachments.
  • Dual Mode: Makes both modes available at the same time.

After installation visit /#Admin/DownloadAllAttachments to enable/disable features.

image

image

image

Requires

  • EspoCRM >= 8.0
  • PHP >= 8.0

Note: This extension has not been tested with other extensions altering the attachment-multiple.js field and may be incompatible.

Installation

Pre-build extension release

  1. Download the latest release from Release page.
  2. Go to Administration -> Extensions and upload the downloaded file.

download-all-attachments's People

Contributors

kharg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

download-all-attachments's Issues

Possibility to add two buttons: download as ZIP or Simple

Hello!

Can you add the possibility of having two buttons to be able to choose whether to download the files as ZIP or individually?

I leave an example

image
image

This allows you to choose the download form according to each email.

Thank you!

New windows when downloading without compression

Hello! Cool extension.

When I select the "single" download mode, a new window/tab opens for each file to be downloaded.

Although this works, it results in after the tabs are closed, the focus doesn't return to the last tab I was positioned on. Also visually it looks a bit strange that tabs are opened and closed so quickly.

I wanted to propose that instead of opening windows: create links and simulate a click with JS, and then delete it.

This is how I do it in one of my projects:

const link = document.createElement( 'a' );

link.style.display = 'none';

document.body.appendChild( link );

for ( let i = 0; i < urls.length; i++ ) {
	filename = ''; // <<< GET THE NAME OF THE FILE TO DOWNLOAD
	link.setAttribute( 'href', urls[ i ] );
	link.setAttribute( 'download', filename );
	link.click();
}

document.body.removeChild( link );

This code is not tested in all browsers, I have only used it in Chrome but it works.

The first time, the user has to accept the multiple download, but it is the same as accepting new windows to open.

In this way the download process is more "clean" for the user.

I'm pretty rusty in programming for Espo to encourage me to do a Pull Request of the code, so I leave it here.

I hope it works.

Greetings!

The button is not shown when there are only images

Hello!

I found a problem. When the email only has attached images, the download all button does not appear.

I leave capture

image
(yes, the client completed the PDF and sends it to me as images ๐Ÿ˜‚)

I don't know what could be due

Saludos!

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.