tavinus / cloudsend.sh Goto Github PK
View Code? Open in Web Editor NEWBash script that uses curl to send files to a nextcloud/owncloud shared folder.
License: GNU Affero General Public License v3.0
Bash script that uses curl to send files to a nextcloud/owncloud shared folder.
License: GNU Affero General Public License v3.0
I am currently trying to upload files to a drop link to Nextcloud version 21.
I am using this example command to upload:
./cloudsend.sh './myfile.txt' 'https://cloud.mydomain.net/s/fLDzToZF4MLvG28'
The upload is done from a alpine 3.13 image with follwing installed:
apk add python3 bash build-base gcc jq coreutils curl
But I am getting this error:
stty: 'standard input': Not a tty
attachments-to-nextcloud | <html><body><h1>400 Bad request</h1>
attachments-to-nextcloud | Your browser sent an invalid request.
attachments-to-nextcloud | </body></html>
attachments-to-nextcloud |
attachments-to-nextcloud |
attachments-to-nextcloud | > Curl exited without errors
Do you have a clue why?
Trying to upload to an existing subfolder, I get the following error and the contradictory message that Curl exited without errors.
Omitting the ?
and everything after it lets me upload the test file to the root of the shared folder without errors.
Is there already a method to upload to subfolders that I am missing?
> ./cloudsend ~/test.csv "https://cloud.url/s/sometoken?path=%2FPhotos%20%2B%20Videos%2FSubfolder" Thu Nov 11 14:24:50 2021
Tavinus Cloud Sender v2.2.1
SENDING SINGLE FILE
===================
test.csv >
######################################################################### 100.0%
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
<s:exception>Sabre\DAV\Exception\NotAuthenticated</s:exception>
<s:message>Username or password was incorrect</s:message>
</d:error>
SUMMARY
=======
> All Curl calls exited without errors
> Attempt to send completed > test.csv
Just noticed I need to add better messages for when globbing (currently saying it is gonna send a single file).
I am tired, so I will do it later.
This is to remind me... ๐
If the name of files or directories contain a hashtag (#) the transfer is not working and is reporting that the resource already exists.
Hello!
I have packaged your script into an RPM package, it is now in the contrib repository of ROSA Linux rosa2021.1
https://abf.io/import/cloudsend.sh
It can be installed on ROSA as dnf install cloudsend.sh
or dnf install cloudsend
.
An RPM can be downloaded from https://abf-downloads.rosalinux.ru/rosa2021.1/repository/x86_64/contrib/release/ and can be installed on other RPM-based distros.
Writing about it just to make you know about it.
Thanks for making this simple, but very useful script! I myself use it for sberdisk.ru (something like a SaaS NextCloud).
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 ??
Use case: I have a file foo.txt
and would like to drop it under the name bar,txt
Potential syntax:
cloudsend foo.txt --remote-file-name bar.txt <folderlink>
Thanks for this great tool!
Following your guide to upload whole folders, I was wondering if it is also possible to preserve the folder tree structure?
It is possible to create folders in the web-interface for a shared link. When a folder is present, one can add it to the url: .../public.php/webdav/folder/bla.txt
. But putting folder
in there without it being present results in an error:
<s:message>File with name folder could not be located</s:message>
Is there a way to create folders on the fly?
Cheers,
Sebastian
Thanks so much for this amazing tool. As I'm using a commercially hosted nextcloud instance which means, I cannot upload files bigger than 10GB. I was wondering if you would be willing to support chunked uploading as described here: https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/chunking.html
What do you think about adding a progress bar like -#
with |tee /dev/null
(like here: https://stackoverflow.com/a/41860083)?
Thanks so much for cloudsend! It arrives just on time for my needs :-)
Would it be possible to send (recursively) a directory instead of a single file?
Probably not: I did not even manage to do it from the file-drop web page.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.