I've been trying to upload files with curl using the POST method. Obviously, this is done to get a bash-script to upload files to my site.
Googled a lot of examples and read the man page but none of the methods seem to work...
This is how I run curl:
#.> curl -F fl=@localfile -F press=K http://<internalip
There is a simple form saved as index.html on the root of this page and this is the form:
<form method="POST" enctype='multipart/form-data' action="cgi-bin/upload.cgi">
<input type="file" name="fl">
<input type="submit" name="press" value="K">
I use "fl=@localfile" as it is supposed to send the whole file, it's a simple ascii file.
the "press=K" refers to the submit button.
When I surf my website and manually fill in the form, there is no problem at all, I can upload the local file to the server so the perl cgi file in the backend is ok. (upload.cgi)
All I get from curl though is just a dump of the html file...
Notice that I also tried with -d but to no avail. Form should be the way to go.
thanks for any hints.