Fix bug introduced in 85ca862a866fcfdedc16d64f04b80121fa2865b4 when file is zero-length

Exception: The value returned from the $saveFileToTempDirectory function is not of type struct.