Download files

Could someone please explain how to use resource.AddFile and sv_downloadurl, I’ve used them before but I’ve forgot how to use them in a script.

i know that resource.AddFile is used to tell the client what files are needed to be downloaded from the server
//the client needs to download a model and materials for a weapon

sv_downloadurl is a command to set up a websever that sends the client files insted of the client downloading it from the server itself
i dont know how to use it exactly but after googleing a bit i found this
gives a good explanation of how to set up sv_downloadurl

resource.AddFile() - Adds any file for the client to download except for Lua files
AddCSLuaFile() - Adds a lua file, must still be include()'d

Downloaded lua files are stored as .dua files in cache/dua/ in your garrysmod folder. These DUA files are compressed and created on the fly, when the client requests them. To completely acquire all necessary dua files, a client must join your server with no previously downloaded lua files.

sv_downloadurl - It’s a console command that you can set to redirect all requests for files to another HTTP server. This speeds the downloads up very much because the gameserver does not have to limit the speeds of the downloads for the client to save bandwidth. This is referred to as FastDL. For all lua to completely work, you must upload all dua files in cache/dua to the FastDL server so that the clients may download them, along with all materials, models, sounds, and other data the client is requested to download.

Ok thanks, I have a place to store the files for use with sv_downloadurl.