How to upload the files using HTTP and and command line tools?

帅比萌擦擦* 提交于 2019-12-25 03:46:10

问题


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?

thank you beforehand.
Arman

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


回答1:


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.

Edit:
The appropriate option seems to be -F "fileFieldName=@/path/to/file;otherField=otherValue;moreFields=moreValues"




回答2:


You can't upload a file directly on a server without any kind of protocol and if you can, this will be a huge security issue.

Try looking at the ftp shell commands in Linux



来源:https://stackoverflow.com/questions/4268959/how-to-upload-the-files-using-http-and-and-command-line-tools

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!