fixed AJAX upload and SQL support