0
我發送很多(每秒幾個)圖像通過FTP到我的網絡服務器。問題是,我向用戶展示了收到的最後一張圖片,但有時最後一張圖片沒有完全傳輸。那麼如何在將圖像顯示給用戶之前檢查圖像是否完全傳輸。如何知道圖像是否已完全傳輸?
$directory = dir($path);
while (false !== ($entry = $directory->read())) {
$filepath = "{$path}/{$entry}";
// could do also other checks than just checking whether the entry is a file
$imageFormats = array(IMAGETYPE_JPEG);
if (is_file($filepath) && filectime($filepath) > $latest_ctime)
{
if(in_array(exif_imagetype($filepath), $imageFormats) && $imageResource = imagecreatefromjpeg($filepath))
{
$latest_filename = $entry;
$latest_ctime = filectime($filepath);
}
}
}
隨着1182代表,你一定知道,我們不能幫你沒有看到任何代碼。請告訴我們你的PHP嗎? –
現在你可以回答我@MichaelBerkowski? – PachinSV