If you are talking about web application,
You cannot upload a folder in a web application. However, after a folder is zipped, it becomes a zip file and can be uploaded.
If you want, a user selects n files and your application should zip it and upload, that's not possible. The user needs to zip the files and upload.
You can unzip the files on the server side using zip applications or may write un-compress algorithm.
7-z[
^] is one such open source compression tool.