简体   繁体   English

使用PHP / CURL上传到远程服务器

[英]Uploading to a remote server using PHP/CURL

Using PHP/CURL, how to upload a file to a remote server wherein the user must be logged in first? 使用PHP / CURL,如何将文件上传到必须首先登录用户的远程服务器?

thanks 谢谢

FYI CURL can pass authentication credentials along like this: FYI CURL可以像这样传递身份验证凭据:

curl --user USER:PASSWORD -s http://localhost:4848/monitoring/domain/server/transaction-service

But it depends on what the server is expecting. 但这取决于服务器的期望。

EDIT: 编辑:
Here's how to send POST data: 这是发送POST数据的方法:

    curl --data "birthyear=1905&press=%20OK%20"         http://www.example.com/when.cgi

Please ask if you have any questions. 请询问您是否有任何疑问。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM