Delphi 搭配 CodeIgniter上傳檔案

php端

[php]
$str_no = $this->input->post(‘strid’);
$filename1 = $this->input->post(‘filename’);
$config[‘upload_path’] = ‘./uploads/’;
$new_name = $str_no.’-‘.$filename1;
$config[‘file_name’] = $new_name;
$config[‘allowed_types’] = ‘*’;
$config[‘max_size’] = ‘1000000000’;

$this->load->library(‘upload’,$config);

if ( ! $this->upload->do_upload(‘myfile’))
{
$error = array(‘error’ => $this->upload->display_errors());

}
else{
$data = array(‘upload_data’ => $this->upload->data());
print_r($data);
}
[php]

Delphi

use IdMultipartFormData
var
PostData: TIdMultipartFormDataStream;
begin
PostData := TIdMultipartFormDataStream.Create;
try
PostData.AddFile(‘myfile’, Self.GetApplicationPath + ‘\file.ini’);
PostData.AddFormField(‘strid’,’999′);
PostData.AddFormField(‘filename’,’file.ini’);

idhttp1.Post(‘http://xxxx/Home/upload/’, PostData)
finally
PostData.Free;
end;

FastReport新版測試

[C#]
DataSet FDataSet;
// 建立資料集
FDataSet = new DataSet();
DataTable table = new DataTable();
table.TableName = “Employees”;
FDataSet.Tables.Add(table);
table.Columns.Add(“ID”, typeof(int));
table.Columns.Add(“Name”, typeof(string));
table.Rows.Add(1, “Andrew Fuller”);
table.Rows.Add(2, “Nancy Davolio”);
table.Rows.Add(3, “Margaret Peacock”);
// 建立報表
Report report = new Report();
// 載入報表
report.Load(@”..\..\report.frx”);

// 註冊資料集
report.RegisterData(FDataSet);
report.GetDataSource(“Employees”).Enabled = true;
// 1 進入設計模式
 report.Design();
// 2 顯示報表
report.Show();
// 3 匯出成pdf
report.Prepare();
PDFExport export = new PDFExport();
report.Export(export, “result.pdf”);

report.Dispose();

[/c#]

Microsoft Drivers for PHP for SQL Server支援PHP7.0

記得之前提過XAMPP支援php連線SQL Server,當時只支援到5.6。但最近因為PHP7.0已釋出後,所以微軟也發佈了支援PHP7.0的4.0版本。
目前支援的版本如下:
Version 4.0 supports PHP 7.0+
Version 3.2 supports PHP 5.6, 5.5, and 5.4
Version 3.1 supports PHP 5.5 and 5.4
Version 3.0 supports PHP 5.4.

下載連結
https://www.microsoft.com/en-us/download/details.aspx?id=20098