A programming language "supported by" the 3DS (most popular are probably C, C++ and Lua... but I haven't looked into that in quite a while)
Libraries for said programming language implementing a network stack, including whatever protocol you want to use for file downloads (HTTP, for example) and the lower layers of the stack (TCP/IP, Wifi itself... the implementation is already provided by the 3DS OS, but even if you want to use that, you will need libraries pointing to those implementations)
A decent implementation plan
Researching other open source software (preferably for 3DS) that already implements the concept of downloading files and storing them to SD (LumaUpdater? Freeshop's self update? FBI's TitleDB and the other homebrews...