[CentOS] Bash cgi upload form

John R Pierce

pierce at hogranch.com
Sun Jan 4 00:13:01 UTC 2009


Sean Carolan wrote:
> Anyone have a function or script for uploading files from a web
> browser with a bash script?  I know this is possible to do with Perl,
> I'm wondering if the same is possible using only bash.
>   

um, you download from a webserver, and upload to one.

wget or curl can be used to download a file from a webserver.

uploading a file TO a webserver requires more infromation, such as what 
upload protocols and authentication does the server support/require?  
one method that can be used is DAV aka WebDAV, cadaver is a command line 
WebDAV client included with CentOS.  

If I'm dealing with a webserver I manage I more frequently use scp 
and/or rsync to move files to/from the server, this typically requires 
user credentials suitable for a ssh login on the server

    $ scp user at hostname:path/to/filename localpath

or

    $ scp path/to/localfile user at hostname:path/to/remote


exchange ssh key credentials first so no password is required.





More information about the CentOS mailing list