Update fileupload js and file attachement widget

Make fileupload plugin works with customised ajax call