Fix file uploads on Windows with SQL Server

Fixes #5845.