server side script for handling chunk upload and session