cloudsend.sh icon indicating copy to clipboard operation
cloudsend.sh copied to clipboard

return URL after uploading ?

Open changchichung opened this issue 2 years ago • 3 comments

chchang@hqdc039:~/git/cloudsend.sh$ ./cloudsend.sh './cloudsend.sh' 'https://nextcloud.com/index.php/s/somesecrets'
Tavinus Cloud Sender v2.2.5

SENDING SINGLE FILE
===================

cloudsend.sh > 
######################################################################### 100.0%

SUMMARY
=======

 > All Curl calls exited without errors
 > Attempt to send completed > cloudsend.sh

how to return URL after uploading ??

changchichung avatar Dec 12 '22 03:12 changchichung

Hi. I am not sure I understand. You want the shared link for the file you just uploaded?

You can't really get that information from this script.

It is possible to list shares from the cloudmanager script, but you may have the same problem of it listing the parent folder instead. This is actually the correct behavior, because there is no shared link for the file inside the folder, just for the folder itself.

I was checking how Nextcloud parses links for files inside shared folders. They use the file ID in the link, like:

https://mycloud.tld/index.php/s/4Qj7xYXRFXa7JHp?path=/&openfile=970672

So, if we could find a way to get that fileID, we could parse the links.

HOWEVER, even when we have the link to the file inside a shared folder, pasting it into the browser will open the parent folder (not the file directly).

So, at this point I don't think there is any way of getting a link to a single file, except when you directly share that single file from the interface (you can also share the file and get the link using cloudmanager).

If you want to stick to cloudsend, I would guess that you are restricted to using the shared folder link (you could have as many as you want though).

tavinus avatar Dec 12 '22 18:12 tavinus

https://cloud.mydomain.net/s/fLDzToZF4MLvG28

https://cloud.mydomain.net/s/fLDzToZF4MLvG28/download?path=%2F&files=yourfilename

%2F stands for / here. i think this should work, if the shared folder has been granted edit permissions

felix-git-hub avatar Aug 08 '23 06:08 felix-git-hub

That is interesting. Will need some testing and investigating.

tavinus avatar Oct 31 '23 19:10 tavinus

Hi there.

It is finally done on v2.3.4.

The link to the main upload target (file or folder) will be printed on verbose info at the end of the run.

cloudsend_masked

Cheers

tavinus avatar Jul 20 '24 04:07 tavinus