Here's some code I whipped up that can download
ASCII files to clients:
function giveFile( userid, contents )
ULib.cexec( userid, "clear" )
ULib.addTimer( 0.5, 1, function()
local lines = ULib.explode( contents, "\r?\n" )
for _, line in ipairs( lines ) do
ULib.console( userid, line )
end
end )
ULib.addTimer( 1.5, 1, function() -- Make sure it all gets through
ULib.cexec( userid, "condump" )
end )
ULib.addTimer( 2, 1, function() -- Make sure it all gets through
ULib.console( userid, " _ _ _" )
ULib.console( userid, "/|\\ /|\\ /|\\" )
ULib.console( userid, " | | | " )
ULib.console( userid, " | | | " )
ULib.console( userid, " | | | " )
ULib.console( userid, "The above line will tell you where the file you downloaded is saved." )
ULib.tsay( userid, "Server has downloaded a file to your client! See console for more information." )
end )
end
As you see, while it's pretty good at giving the file correctly, you have no control over the saving on client-side.