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

Copy direct download link #16377

Closed
wants to merge 1 commit into from
Closed

Copy direct download link #16377

wants to merge 1 commit into from

Conversation

RT4U
Copy link

@RT4U RT4U commented Jul 13, 2019

I've seen this feature requested a lots of times. Also I've been searching for a feature like this since my installation of nextcloud. But to no avail, can't seem to find any. I decided to take matters on my own hands and did some coding to add this feature.

This will add a new option to Right Click menu, or options menu in the file row.

When you click Copy Download Link option from it.

1)It first checks if there are any shares available for the particular file.
2)If yes, it automatically grabs the share link and appends "/download" (When specified, the file will be downloaded) and automatically copies it to the clipboard.
3)If there's no share available for the file, it just creates a new share and repeats "Step 2"

I've seen this feature requested a lots of times. Also I've been searching for a feature like this since my installation of nextcloud. But to no avail, can't seem to find any. I decided to take matters on my own hands and did some coding to add this feature.

This will add a new option to Right Click menu, or options menu in the file row.

When you click Copy Download Link option from it.

1)It first checks if there are any shares available for the particular file.
2)If yes, it automatically grabs the share link and appends "/download" (When specified, the file will be downloaded) and automatically copies it to the clipboard.
3)If there's no share available for the file, it just creates a new share and repeats "Step 2"
@jancborchardt
Copy link
Member

@RT4U could you show screenshots of the changes so it’s easier to quickly review for @nextcloud/designers? :)

I already fear that it will be too present if you say it’s in the menus. Should rather be in the menu of the share link only, and on the share link page that a recipient gets?

@RT4U
Copy link
Author

RT4U commented Jul 16, 2019

@RT4U could you show screenshots of the changes so it’s easier to quickly review for @nextcloud/designers? :)

I already fear that it will be too present if you say it’s in the menus. Should rather be in the menu of the share link only, and on the share link page that a recipient gets?

Yup sure, here's the screenshot of the modified changes live on my personal server.

It is shown right under the Context Menu when you do Right Click or accessible from the options menu like shown in this screenshot.

nextcloud-copy-download-link-1

These are the checks made and notifications shown when you press that option.

nextcloud-copy-download-link-2

As for the, placing options, that is where to place this feature. I guess for me personally, it's best to place it in the context menu just as it is currently placed in the images. Just two clicks away, click on context menu, click Copy download link and you get the direct download link in your clipboard, which can be shared with anyone.

P.s - Also I added this feature in the Nextcloud android app and it's working flawlessly, will make a pull request on the Android git soon.

@jancborchardt
Copy link
Member

As for the, placing options, that is where to place this feature. I guess for me personally, it's best to place it in the context menu just as it is currently placed in the images. Just two clicks away, click on context menu, click Copy download link and you get the direct download link in your clipboard, which can be shared with anyone.

Yes, I can see your thinking behind this. Unfortunately if we place so many actions in present locations then the really important ones are lost in a sea of other ones.

I've seen this feature requested a lots of times.

Could you link some of them so we can analyze what the requirements are to work on a design for this?

As proposed above:

Should rather be in the menu of the share link only, and on the share link page that a recipient gets?

What do you think @RT4U @nextcloud/designers?

@RT4U
Copy link
Author

RT4U commented Jul 16, 2019

Mostly a Google search for "direct download link nextcloud" brings out a bunch of links including nextcloud help forums, also the ones I referenced in this request. Yes, the placing options can be changed according to one's preference. May be a setting option for that would be good. Personally, I used to download lots of files off my nextcloud server, so I need a quick access to direct download link, so I can paste it in my downloader or share it to a friend or a colleague. Hence why I made this feature

@jancborchardt jancborchardt added 0. Needs triage Pending check for reproducibility or if it fits our roadmap design Design, UI, UX, etc. feature: files needs info labels Jul 16, 2019
@skjnldsv
Copy link
Member

Yeah, I think this is not really the way to go.
Thanks a lot for the help though! I really appreciate. But this is confusing!

What download link are we talking about? public, internal, user?

I think we should not add another way of creating a new share from the menu.
The ui is already pretty clear and your pr will actually create security issues. What if password is enforced? What if expiration date is enforced? A user needs to know he's creating a link share and not just copying any download link. :)

@RT4U
Copy link
Author

RT4U commented Jul 23, 2019

Yeah, I think this is not really the way to go.
Thanks a lot for the help though! I really appreciate. But this is confusing!

What download link are we talking about? public, internal, user?

I think we should not add another way of creating a new share from the menu.
The ui is already pretty clear and your pr will actually create security issues. What if password is enforced? What if expiration date is enforced? A user needs to know he's creating a link share and not just copying any download link. :)

It is just my personal implementation, other checks may be added like checking enforcement. Also the user gets notified about creating shares when he click that menu option. So he would know he's creating a share for it, so I don't know if it would be a security issue, because the user is aware of it.

@skjnldsv
Copy link
Member

I still feel the confusion :)
Also, it takes the first share link that exists, which for security purpose can also NOT be the share the user wanted.

It would means that if I have 3 share link on a file, it would ignore the other two.

@RT4U
Copy link
Author

RT4U commented Jul 23, 2019

I still feel the confusion :)
Also, it takes the first share link that exists, which for security purpose can also NOT be the share the user wanted.

It would means that if I have 3 share link on a file, it would ignore the other two.

Oh ya now got a clarification on your concern. Yes it's indeed true, that the first share should not be taken automatically. At least the script should check if any public shares exists first, if none it makes a public share. So the security issue can be eliminated by checking if the existing share is public or not.

@skjnldsv
Copy link
Member

Still, then it would create a new share each time, which is also not something we want.
I don't see how such shortcut can be implemented properly.
Sorry, but I think we will close this :/

Copy download link should stay in the sharing sidebar section. Anything else will be confusing for the user.

@RT4U
Copy link
Author

RT4U commented Jul 23, 2019

Still, then it would create a new share each time, which is also not something we want.
I don't see how such shortcut can be implemented properly.
Sorry, but I think we will close this :/

Copy download link should stay in the sharing sidebar section. Anything else will be confusing for the user.

It won't create a new share each time it checks if it already has a share, then it just gives out the existing share link. As to tackle your security issue, we can check if the existing shares is public if yes, then it will be copied if else it creates a new public share.

This is a very easy way to grab a direct downloadable link for any files in Nextcloud which can be shared around the world in an instant.

It's just a combination of creating a new share and appending /download to it. Any user wants a direct download link would know the risks of sharing it with others.

Either way, I wouldn't say this is perfect. It just implements what I wanted and most of the others in GitHub and help sites wanted

@juliushaertl
Copy link
Member

juliushaertl commented Jul 24, 2019

I would also vote against having this as an addition menu entry shipped by default. The "download link" is a totally different term from share link and doesn't imply that it is a public share that you are creating. The use case is also a rather technical one imo, as for normal users the regular share page provides some more context about the file that is shared. @RT4U How about creating a separate app for that?

@jancborchardt
Copy link
Member

Fully agree with @juliushaertl here, I would also recommend that you develop this as a separate app and publish it on the Nextcloud app store at https://apps.nextcloud.com :)

This often happens with more specific features, the app store is a perfect way to keep the core lean and trial new things. Eventually when there’s a big demand for it and they are matured and the design is streamlined, we can always think about integrating them.

@skjnldsv skjnldsv closed this Jul 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap design Design, UI, UX, etc. feature: files needs info
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants