
addEventHandler( 'onClientFileDownloadComplete', root, function( fileName, success, reguestResource )
	outputChatBox( string.format( 'Downloaded %s from resourceRoot %s. Success: %s. Reguest by %s', tostring( fileName ), tostring( source ), tostring( success ), tostring( reguestResource ) ) )
end )

addCommandHandler( 'downloadTest', function()

	iprint( 'this resource root', resource:getRootElement() )
	if Resource.getFromName( 'anotherResource' ) then
		iprint( 'another resource root', Resource.getFromName( 'anotherResource' ):getRootElement() )
	end

	iprint( 'download from main resource', downloadFile( 'test' ) )
	iprint( 'download from main resource with long path', downloadFile( 'dir/dir2/test' ) )
	iprint( 'download from main resource invalid file', downloadFile( 'nothing' ) )
	iprint( 'download from another resource', downloadFile( ':anotherResource/test' ) )
	iprint( 'download from another resource with long path', downloadFile( ':anotherResource/dir/dir2/test' ) )
	iprint( 'download from another resource invalid file', downloadFile( ':anotherResource/nothing' ) )
	iprint( 'download from admin resource', downloadFile( ':admin/server/admin_ACL.lua' ) )
	iprint( 'download from root path', downloadFile( ':internal.db' ) )
end )