-
Notifications
You must be signed in to change notification settings - Fork 338
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
Allow multiple images to be uploaded at once #777
Comments
We just use the browser native file uploader, which could support multiple images, but I wouldn't want to implement that as it'd potentially be a way to subvert the image rate limit. |
Dear @dessalines, i was planning to implement this but only if you agree to merge it later. Or if needed make it configurable? My plan is to implement it perfectly with an async parallel upload (e.g. 3 parallel uploads). We might need to adjust the rate limit i agree. Please reconsider. |
Yes I would merge this if you added it. Now that I think of it, the backend's rate limits would still be functioning, which is the main thing for me. So far one of lemmy's main limitations is that picture uploads are quickly filling up hard drive space, and I don't like to do much to exacerbate that. |
Ok, cool. Regarding disk usage: Honestly that is the problem of the owner or hoster of an instance. But we can always make this configurable if you think that's important. I'll share some of my design ideas later if you want to review them. I guess i will modify the image-upload-form.tsx to be configurable for multi upload (as it's used for clear single-upload only as well for avatars and icons). Default is single-upload. |
@dessalines It already works with a simple forEach loop. We need the following decision: Should we present a toast top right for each image or one at the end to delete all the uploaded ones? I would only present that at the end. Also I would toast for each failed image and also try to output the users original file name, so he knows which one failed. Also we could add two more checks:
What do you think? |
I would let the images insert themselves, and the delete toasts pop up individually as the images get uploaded. Seems like the least work. The max # of images could just be a hardcoded value, something like 10 max seems good to me, and is also the default rate limit. The max file size per image is going to be set by the server, ones over a certain amount will get rejected automatically. |
Alright cool. It's almost ready. Can you help me understand this part in the else clause:
Not sure what the event is instead of a file upload?! How would i test this clause? I'll just try to call the code as before, but i was wondering. |
@dessalines Would you take the pull request on the 0.16.7 version or in main only? I cannot get main to work at the moment, so i'm not sure. |
I'm not sure that the else is even necessary, but I'd have to test. You can develop wherever you like, but please do your PR commits to main. |
Is your proposal related to a problem?
Not directly. Uploading many pictures is a time-intense process with the current implementation. Each image has to be selected by hand.
Describe the solution you'd like
Allow the picture open dialog to select multiple images at once, and upload all of them afterwards, resulting in multiple links being inserted into the markdown body.
Nice to have:
Describe alternatives you've considered
Drag and drop, but I'd prefer the open dialog, it's more common.
Additional context
I'm sure there is an existing typescript component that could be used. How difficult is this to implement?
The text was updated successfully, but these errors were encountered: