The JQuery nailthumb
is use client side code to create thumbnails from the image, not for save it, not for manipulation, only for show it.
What you look for is server side code to create thumbnails, nothing to do with javascript and client side - beside maybe some code to manual manipulate and send the results on server to make the final process.
Here is one example of thumnails creation on code in asp.net but there are too many more if you search on the internet