ก่อนอื่นตรวจสอบให้แน่ใจว่าในปลายทางของคุณคือเปิดใช้งานไฟล์ -> สร้างทรัพยากร
และใน "ฝั่งลูกค้า" ฉันทำสิ่งนี้:
/**
 * Upload a file using services 3.X
 * 
 * @param the path of the local file
 * @return bool|int the fid of the file.
 *
 * 
 * With the fid you can attach this file in the node object before to be send.
 * ej.
 * $node->title = 'My remote node';
 * $fid = node_upload_image('/The_path/to_the/local_file.jpg');
 * $node->file_field[0] = array( 
 *    'fid' => $fid,
 *    'list' => 1,
 *    'data' => array()
 * );
 * // Other fields related with the node.
 * ...
 * 
 * // Sending the node.
 * $data = http_build_query($node, '', '&');
 * $response = drupal_http_request('myremotesite.com'. '/node', array(
 *   'Accept' => 'application/json', 
 *   'Cookie' => 'auth_cookie_info'
 * ), 'POST', $data);
 *
 * Done. 
 */
function node_upload_image($image_path) {
  $file = array(
    'filesize' => filesize($image_path),
    'filename' => basename($image_path),
    'file' => base64_encode(file_get_contents($image_path)),
    'uid'  => 1  // This should change it by the user who use the service.
  );
  $data = http_build_query($file, '', '&');
  $response = drupal_http_request('myremotesite.com/myservice-endpoint' . "/file", array('Accept' => 'application/json', 'Cookie' => 'auth_cookie_info'), "POST", $data);
  if ($response->code == 200) {
    return json_decode($response->data)->fid;
  }
  $this->error =  $response->status_message; 
  return false;
}
ฉันทำสิ่งนี้จาก Drupal ตัวอื่นและสำหรับ Drupal 6 พอร์ตรหัสไปยัง D7 ควรจะง่ายและฉันคิดว่าคุณได้รับแนวคิดทั่วไปเกี่ยวกับวิธีการทำ