— My server seems to respond with status 401 for wrong username / password
— You generally just check if status is 200-299 for OK
— Let me explain myself: I have an app and a file in a separate folder, protected via .htaccess. If I press a button to load the protected file, my server asks for username and password. If I cannot do the login I am unable to load the file... it is possible to detect with a script that I cannot load the protected file?