forscht / ddrive

Discord as a filesystem.
https://ddrive.forscht.dev
MIT License
490 stars 98 forks source link

[SUGGESTION] Batch Upload Files #36

Closed Ra-pira closed 1 year ago

Ra-pira commented 1 year ago

exactly as the title says

idanyas commented 1 year ago

No one seems to have answered yet. You can use the built-in API and curl.

Upload file:

curl -X POST -T file.txt http://localhost:8080

Download file:

curl -o file.txt http://localhost:8080/file.txt

Create a directory:

curl -X PUT http://localhost:8080/media/

Delete a file/directory:

curl -X DELETE http://localhost:8080/file.txt
curl -X DELETE http://localhost:8080/media/

Replace https://localhost:8080 with your URL. In addition, there is a dclone that can upload an entire directory.

idanyas commented 1 year ago

there is also an identical issue here, but here I have described it in more details.

Ra-pira commented 1 year ago

Replace https://localhost:8080 with your URL. In addition, there is a dclone that can upload an entire directory.

whats the correct usage of the dclone path command? tried using it but it goes nowhere, i can't find it in the html page

forscht commented 1 year ago

Replace https://localhost:8080 with your URL. In addition, there is a dclone that can upload an entire directory.

whats the correct usage of the dclone path command? tried using it but it goes nowhere, i can't find it in the html page

npm i -g @forscht/ddrive dclone -t token -c channel -p ./

NoNameLmao commented 1 year ago

made a small .sh script since i host ddrive from termux:

for file in /local-path/*
do
        # if you have auth credentials set in ddrive, specify them in curl using "--user user:pass"
        # $file is the path+filename, "basename" command returns just the filename
        curl -X POST -T $file http://127.0.0.1/ddrive-path/$(basename $file)
done

helps when i need to upload a lot of files inside one folder

forscht commented 1 year ago

This improvement has been added in version v4.0