您必须使用具有上传脚本的服务器以接收 PRT 文件。PRT 使用 HTTP POST 机制,在上传脚本中包含以下参数(利用多部分 MIME 编码):
-
devicename(例如:“SEP001122334455”)
-
serialno(例如:“FCH12345ABC”)
-
username(Cisco Unified Communications Manager 中配置的用户名,设备所有者)
-
prt_file(例如:“probrep-20141021-162840.tar.gz”)
示例脚本如下所示。此脚本仅供参考。思科不支持客户服务器上安装的上传脚本。
<?php
// NOTE: you may need to edit your php.ini file to allow larger
// size file uploads to work.
// Modify the setting for upload_max_filesize
// I used: upload_max_filesize = 20M
// Retrieve the name of the uploaded file
$filename = basename($_FILES['prt_file']['name']);
// Get rid of quotes around the device name, serial number and username if they exist
$devicename = $_POST['devicename'];
$devicename = trim($devicename, "'\"");
$serialno = $_POST['serialno'];
$serialno = trim($serialno, "'\"");
$username = $_POST['username'];
$username = trim($username, "'\"");
// where to put the file
$fullfilename = "/var/prtuploads/".$filename;
// If the file upload is unsuccessful, return a 500 error and
// inform the user to try again
if(!move_uploaded_file($_FILES['prt_file']['tmp_name'], $fullfilename)) {
header("HTTP/1.0 500 Internal Server Error");
die("Error: You must select a file to upload.");
}
?>
 注 |
|