Added the function to be called for automatic upload.