I'm trying to write an asp.net Web Api Restful service by means of which I need to send (.html,.css,.js,.png images) files (and all these files are part of a little JQuery mobile application written using Visual Studio 2013 with new multi device hybrid thing .i.e. Cordova extensions) to the mobile client within one request.
I'm stuck with two questions in my head.
First how to send these files to the client within one request. Do I need to zip them up and then return to the client? If zipping them up is a viable option do I need to maintain the hierarchy of folder and subfolders (inside the zip file) as is maintained in the Visual Studio project. Why I'm asking this because I'm referencing (linking) some images from images folder into .css file in CSS folder and also referencing to custom JavaScript files from scripts folder into .html files (apparently using tag) inside Visual Studio Project, so I think if I don't maintain the same hierarchy at the client side (once all the files are unzipped and extracted to the local file system at the client side) then It would be impossible for the browser to rightly display views(.html files) to the client when the client is offline. That's what I'm trying to do with these downloaded files on the client.
Now the second question is how to programmatically zip these files into one .zip file so that hierarchy of folders and subfolders within .zip file stays intact. I have seen so many articles/tutorials, stackoverflow posts and ZipFile api as well as DOTNETZip api but none of these describes how to zip various files into one zip file and maintain the same hierarchy of folders and subfolders inside the .zip file as it is in Visual Studio.
I'm new to this concept to zipping up files and serving them to mobile client so I'm not sure what I'm asking is right or there exists an alternate to returning zip file and then unzip and extract it on client side.