Have you looked at the sample application entitled"HTTP File System Sample"? This is in new->new-?NET+OS Sample Project
Also and this is NOT well documented, to have the file system work in conjunction with the Web Server you MUST have APP_FILE_SYSTEM defined either in appconf.h or from ESP right click on your project click properties. Then C/C++ Build. Then Tool Settings. Then C Compiler->symbols. Add the symbol APP_FILE_SYSTEM. With APP_FILE_SYSTEM UNDEFINED, all of the file system APIs that the web server interacts with are no-ops and you'd get 0 length files, but the FTP server would still work (uses a different interface).