任务是
1)首先从数据库中生成csv文件(我已经完成了)
2)现在将生成和下载的csv文件上传到infusionsoft api
<?php
$host="localhost";
$uname="root";
$pass="";
$database = "detail";
$connection=mysql_connect($host,$uname,$pass);
$selectdb=mysql_select_db($database) or die("Database could not be selected");
$output = "";
$table = "information"; // Enter Your Table Name
$sql = mysql_query("select * from $table");
$columns_total = mysql_num_fields($sql);
for ($i = 0; $i < $columns_total; $i++) {
$heading = mysql_field_name($sql, $i);
$output .= '"'.$heading.'",';
}
$output .="\n";
while ($row = mysql_fetch_array($sql)) {
for ($i = 0; $i < $columns_total; $i++) {
$output .='"'.$row["$i"].'",';
}
$output .="\n";
}
$filename = "myFile.csv";
header('Content-type: application/csv');
header('Content-Disposition: attachment; filename='.$filename);
echo $output;
exit;
?>
从此代码生成并下载 csv 文件......现在如何在 infusionsoft api 中上传 csv 文件.....