Home >Backend Development >PHP Tutorial >Drupal sends a file through cURL Post_PHP tutorial
This article will introduce you to a Drupal implementation of sending a file through cURL Post. If you are using Drupal cms, feel free to check it out for reference.
It is well known that PHP’s cURL extension can be used to simulate form submission. There is the drupal_http_request function in Drupal to perform an HTTP request. It can send a file through POST, but it is not as convenient to use as cURL. Here we mainly explain how to post a file to a remote server address in Drupal.
Web Form
代码如下 | 复制代码 |
The form above contains demonstration text boxes, passwords, check boxes and file submissions.
Drupal cURL simulates form submission POST
The code is as follows
|
Copy code
|
||||
$url = ‘http://blog.lixixp.com/demo/http_request/post.php’; |
true