Solved Simple files transfer across the web

on mac and windows (or kde / gnome) you just mount https://host/dir

I am now a little wiser, but only a little. I have a mail account at web.de, and it offers webdav.
I can transfer files to there with

curl -T localfile --user username@web.de 'https://webdav.smartdrive.web.de/dir/'

but curl -X does not work (see man curl).

Perhaps -T uses old http PUT and not a new WebDAV command.

UPDATE
The following worked to create a directory dir:

curl -X MKCOL --user username@web.de https://webdav.smartdrive.web.de/dir/

Important was to add "/" at the end. And the following deleted it:

curl -X DELETE --user username@web.de https://webdav.smartdrive.web.de/dir/



There is 'sshfs' as a solution otherwise
If he is used to the command line, ssh and scp are enough. He can do things like:

ssh user@remote ls dir
scp localfile user@remote:dir
 
Of course he can use scp,rsync,or ssh but sshfs also exists as another possibility which in his case could be more convenient since he won't have to type a new command for any files he wants to transfer, somehow just like filezilla would do, I mention filezilla because OP seems more of a FTP guy.
More solution is better than not enough, after that OP just has to pick one, well it's my opinion though :)
 
Thanks, I didn't know that. But, I don't run Apache. No web server on this machine, so to speak.

diizzy

However, I have tested miniserve in a jail and it works great. There is a problem I can't solve, it is the handling of mime-type. In a browser, documents like text and picture are displayed and not downloaded. I know this is the expected behaviour from the miniserve author's point of view, but I would like to force the mime-type to application/octet-stream in order to avoid that. Not sure it's possible.

Anyway, this can be a solution if one can download movies and mp3. I have to do some additional testings.
It looks like you need to edit source code but you might want to open an issue upstream and ask if there's a way to override.
 
A few news about what I choose so far.

For people who want to download files, I run miniserve in a jail. I set the https protocol to add some security (but, as I have an auto signed certificate, it will be less obvious for simple Windows people unless I install in their browser my own certificate authority). No upload is allowed.

To upload some file, I created a simple jail with only sshd and mounted my media directory with nullfs. From there, I use sftp not only because it's a little more secure, but also and mainly because it's simpler from a network point of view (only one TCP connection, no passive ports mess). I definitely get rid of the FTP protocol.

Thanks to you all.
 
Back
Top