Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show other file types as download link #5

Open
rasos opened this issue Aug 7, 2019 · 4 comments
Open

Show other file types as download link #5

rasos opened this issue Aug 7, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@rasos
Copy link

rasos commented Aug 7, 2019

Other file types than images are not shown as download link.

Bildschirmfoto_dateien_falsch

As the sister plugin ep_fileupload has an unresolved cross origin issue redhog/ep_fileupload#24 and is un-usable, it would be nice to extend the functionality by showing a download link for non-image MIME types.
"fileTypes": ["jpeg","jpg","bmp","gif","png","pdf","mp4","ogg","mp3","webm","wav","md","rtf","tex","txt","doc","docx","xls","xlsx","pptx","ods","odt","odp","html","pages","py","zip"],

@JohnMcLear
Copy link
Collaborator

I'm not sure I understand this issue @rasos ;/

@JohnMcLear JohnMcLear added the enhancement New feature or request label Feb 9, 2021
@rasos
Copy link
Author

rasos commented Feb 14, 2021

The idea was that this plugin also allows other file types to be uploaded, such as a PDF to be shared.

If I add pdf as file type, we get an exception when uploading a pdf:

[2021-02-14 10:36:36.097] [ERROR] console - TypeError [ERR_INVALID_URL]: Invalid URL: testboard3/347a01bb-1931-49fd-8c06-2545ebc5f27c.pdf
    at new NodeError (node:internal/errors:329:5)
    at onParseError (node:internal/url:282:9)
    at new URL (node:internal/url:358:5)
    at new URL (node:internal/url:355:22)
    at Busboy.<anonymous> (/opt/etherpad-lite/node_modules/ep_image_upload/index.js:132:24)
    at Busboy.emit (node:events:378:20)
    at Busboy.EventEmitter.emit (node:domain:470:12)
    at Busboy.emit (/opt/etherpad-lite/node_modules/busboy/lib/main.js:38:33)
    at PartStream.<anonymous> (/opt/etherpad-lite/node_modules/busboy/lib/types/multipart.js:213:13)
    at PartStream.emit (node:events:378:20)
    at PartStream.EventEmitter.emit (node:domain:470:12)
    at HeaderParser.<anonymous> (/opt/etherpad-lite/node_modules/dicer/lib/Dicer.js:51:16)
    at HeaderParser.emit (node:events:378:20)
    at HeaderParser.EventEmitter.emit (node:domain:470:12)
    at HeaderParser._finish (/opt/etherpad-lite/node_modules/dicer/lib/HeaderParser.js:68:8)
    at SBMH.<anonymous> (/opt/etherpad-lite/node_modules/dicer/lib/HeaderParser.js:40:12)

I understand that for each media type (audio, video) an extra plugin is required. There is none for documents yet (PDF, docx, xlsx etc).

@JohnMcLear
Copy link
Collaborator

Oh that wasn't within scope with plugin description as I read it. My apologies if I missed that..

I won't get chance for a few months to look at this but the code is not very readable and maintainable so it should be relatively simple for a developer to add this functionality.

@TheDarkTron
Copy link

Comment from so completely unrelated: I doubt that the ep_image_upload plugin is the right place for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants