如何使用HTTP和命令行工具上传文件? [英] How to upload the files using HTTP and and command line tools?
问题描述
我有一个LAMP服务器。我只有Http(80)和HTTPS(443)端口是开放的。
用户可以使用 PHP 表单上传文件。
有些用户正在使用 wget
下载文件。
有使用命令行工具上传文件的方法吗?
I have a LAMP server. I have only Http(80) and HTTPS(443) ports are open.
The users can upload files using PHP form.
Some users are downloading files using wget
.
Are there way to upload files using command line tools?
事先感谢。
Arman
thank you beforehand.
Arman
解决方案(感谢R. Bemrose)
使用libcurl可以从命令行上传文件:
nice tutorial: http://www.maheshchari.com/upload -image-file-to-remote-server-with-php-curl
SOLUTION(thanks to R. Bemrose)
using the libcurl One can upload files from command line:
nice tutorial: http://www.maheshchari.com/upload-image-file-to-remote-server-with-php-curl
推荐答案
curl
库具有命令行工具。我忘了确切的选项,但 curl
可以用来发布文件,就像它是从一个表单。
The curl
library has a command line tool. I forget the exact options to do it, but curl
can be used to post files as if it were from a form.
编辑:
相应的选项似乎是 -FfileFieldName = @ / path / to / file; otherField = otherValue; moreFields = moreValues
这篇关于如何使用HTTP和命令行工具上传文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!