server:
function startImageDownload(player)
fetchRemote ("https://i.imgur.com/Aa9kXWi.jpeg", sendFiletoClient, "", false, player) -- use direct link for this
end
function sendFiletoClient(responseData, errorCode, player)
if (errorCode == 0) then
triggerClientEvent(player, "printImageInfo", resourceRoot, responseData)
end
end
local player = getPlayerFromName("Burak2346") -- change with your nick
startImageDownload(player)
client:
addEvent("printImageInfo", true)
addEventHandler( "printImageInfo", resourceRoot,
function(pixels)
local image = fileCreate ("image.jpeg")
fileWrite(image, pixels)
local fileSize = fileGetSize(image)
outputDebugString(fileSize)
fileClose(image)
end
)
Since it calculates the file size in bytes, you can do some math and convert it to the size you want, such as kb, mb.