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

[Feature] Allow multiple files #1060

Open
Mushoz opened this issue Feb 14, 2023 · 6 comments
Open

[Feature] Allow multiple files #1060

Mushoz opened this issue Feb 14, 2023 · 6 comments

Comments

@Mushoz
Copy link

Mushoz commented Feb 14, 2023

I was looking into the possibility of adding multiple files to a single paste. I came across this issue: #665

It sounds like this was never implemented. Our use-case for our self-hosted privatebin instance is to secure send files over email. For most data we simply email the link to the file(s) that we want to share. While it doesn't offer a ton of extra security over simply sending over the files as a regular mail attachment, the fact that files are automatically deleted ensure that the files will never linger in different outboxes and inboxes.

Furthermore, for higher risk data, we can mail the link, and communicate a password over a separate communication channel (such as e2e encrypted chatting applications). This does give us additional security over regular emails.

While we can simply zip multiple files together, I think it would be nice to be able to send multiple files within a single paste. I understand our use-case might be a bit niche, but perhaps more users might be willing to chime in if this would be a useful feature for them? If it's a popular feature, it might be worth implementing. Thank you very much in advance for considering this!

@elrido
Copy link
Contributor

elrido commented Feb 14, 2023

[...] If it's a popular feature, it might be worth implementing. Thank you very much in advance for considering this!

I've added the relevant labels, but be aware that what will be required for such an enhancement to get implemented is somebody stepping up and start working on a branch. Given that everyone works on this in their spare time, the motivation isn't usually in upvoted issues, but in the fun of implementing the function.

This particular one requires introducing a new version of the paste format, ideally in a backward compatible fashion, that includes some new list of files and of course the UI changes to list them all - it will mostly require JavaScript skills. If anyone feels up to the challenge, I'm happy to provide pointers to the relevant docs and code sections or collaborate in a branch.

@johnnyq
Copy link

johnnyq commented Feb 19, 2024

@elrido HTML5 supports multiple file uploads

<form enctype='multipart/form-data' method='POST' action='uploadFiles.php'> 
     <input type="file" name="files[]" multiple="multiple">
     <button type='submit'>Submit</button>
</form>

Then can be handled on the backend with a simple for loop, no javascript needed

@johnnyq
Copy link

johnnyq commented Feb 19, 2024

Mentioned here but was dup of this one. #1253

@elrido
Copy link
Contributor

elrido commented Feb 22, 2024

@elrido HTML5 supports multiple file uploads

I'm well aware that browsers supported this even back with HTML 4 since the late naught's: https://caniuse.com/input-file-multiple

Then can be handled on the backend with a simple for loop, no javascript needed

This is not a backend limitation, rather the encrypted payload format and paste format version needs to get extended and the client code added to support reading multiple files.

ATM there are two attributes "attachment" and "attachment_name" in the JSON payload. This needs to be extended to either optionally become a list/array or a new set of attributes needs to be introduced and the "v" (version) attribute on the outside paste format get incremented. And of course the new client code needs to be able to handle both the old one-attachment format and the newer one that can contain multiple files.

I'm happy to give you more pointers which bits of privatebin.js you will want to look at. May I assign you this task?

@chodorenko
Copy link

It seems to me that this would be a popular feature. Maybe the developers could implement it?

@elrido
Copy link
Contributor

elrido commented Apr 9, 2024

@chodorenko would you be willing to become that developer?

We desperately need more developers in this project to get things done. My focus is on other issues and without outside help it is very unlikely I'll ever get around to this one. As I volunteered, I'm happy to provide any pointers to help anyone that would likes to pick this task up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants