add function upload to form when options.defer ture

This gives the possibility to make specific settings for request or limit the upload after authentication