I have been working on providing the security related to the XSS attacks. My website only allows following mime-types:
XML, CSV, HTML, PLAIN, VND_WAP_WML, APPLICATION_ZIP, APPLICATION_PDF, APPLICATION_VND_FDF, APPLICATION_MS_WORD, APPLICATION_OCTET_STREAM, APPLICATION_VND_MS_POWERPOINT, APPLICATION_X_VISIO, IMAGE_GIF, IMAGE_PNG, IMAGE_TIF, APPLICATION_VND_MS_OUTLOOK, APPLICATION_DOWNLOAD, APPLICATION_JSON
I have sanitized HTML files using antiSamy. How can I ensure that the data in the files is safe before uploading the data to database, and prevent persistent XSS attacks?