-1
我正在使用Scott Vanderbeck的微軟標籤php庫。微軟標籤下載條形碼到磁盤
它具有將條形碼作爲圖像輸出到瀏覽器的功能,但是我想下載並保存到磁盤。我的目標是循環瀏覽所有標籤,並將每個條形碼作爲圖像下載到磁盤上。我不知道如何做到這一點。我的代碼 require_once('MSTag_v2.php');
$MSTagAuthToken = "your token";
//Create an MSTag interface instance
$msTag = new MSTag();
//Create User Credentials
$userCredential = new UserCredential($MSTagAuthToken);
//Display Microsoft Tag image in browser
$result = $msTag->GetBarcode($userCredential,'MAIN','Cyclamen coum Pewter','jpeg',1);
if($result)
{
ob_start();
$length = strlen($result);
header('Last-Modified: '.date('r'));
header('Accept-Ranges: bytes');
header('Content-Length: '.$length);
header('Content-Type: image/jpeg');
print($result);
ob_end_flush();
exit;
}
else
{
echo $msTag->getLastException();
}