HTTP put backup

I’m trying to upload backups to a central site. And of course, in 2018, FTP is not an option.

This is my script:

/tool fetch mode=https http-method=put  url="https://myS3ApiGateway.amazonaws.com/router/pepe.backup" keep-result=no http-data=[/file get pepe.backup contents ]

But I’m obtaining empty zero bytes files.

The problem is that I can’t get the content of backup file:

:put  [:len [/file get pepe.backup contents ]]
0

Anybody knows how can I HTTP PUT a backup?

After some test, I’ve discovered that the problem is that you can’t get file contents greater than 4KBytes.

Then I have other problem: I don’t know how to use a file as palyload for /tool fetch http-method=put

Did anyone ever present a solution to this? I would like to upload a backup file to webserver (running nextcloud) using the put method. How can this be done?

A method using curl works like this (both examples with the variables defined beforehand of course):

curl -s -u ${user}:${pass} -T ${filedir}/${file} "${baseurl}/remote.php/dav/files/${user}/${savepath}/${file}"

I’ve tried something like this:

/tool fetch address=$address host=$address mode=https http-method=put src-path=( "$file" . ".backup" ) dst-path=( "$savepath" . "/" . "$file" . ".backup" ) user="$user" password="$pass";

(I also tried with the src-path more like the dst-path.) While it does connect, it uploads/creates a zero-byte file. How can I attach the backup file to upload it?

TIA!

The file command it’s which has the problem with files greater than 4KBytes. I tried it first to capture the contents of the file within the API.

It seems there it’s not any other way than mode=ftp to upload files to one external server.

The /tool fetch don’t accepts to upload files with http-method=put or http-method=post

You can use SFTP (transport over SSH) to securely upload your files.

Yes I know, but it will be easier to use TFTP-upload or HTTP(s)-upload because there are lots of free components outside. For SFTP it’s a bit difficult and expensive to add it to one self-made application

All you need is a SSH server with SFTP implementation. I guess OpenSSH is used the most, but there are others. What’s expensive about it?

I’m talking about embedding all in one application. I know I can use one external SFTP/SSH server, but If you want to release one application with all inside that external SSH server it’s an extra.

I don’t know how why it’s so difficult to add http/https upload when they have the http/https protocol coded at this moment.

now only (s)ftp can do upload=yes
i need HTTP(s) put backup too~i hope fetch add this~