The existing (web-based) project I'm working on uses the client data and saves reports using the client name as the file name. Unfortunately, he never filtered this client name, so someone entered client names containing a colon (for example, "workshop: alex") for testing purposes. This leads to a file name wizard: alex.pdf, which seems to be quite applicable to NTFS systems. (Because it creates a file called “workshop” that contains an alternative data stream called “alex.pdf.” Since the application also stored the file names, it had no problem reading them again, as it simply referred to the same ADS., No one noticed this problem ...
However, I recently started working on this project, and it needs to be ported to the 64-bit version of Windows 7 with IIS 7. And suddenly the site no longer worked with these ADS files! It didn't take me long to find the reason and understand why she had never lost in the past. (and I also cursed previous developers who never tested this!) But now I wonder why this fails in Windows 7 ... So, does anyone know?
I have a fix, by the way! Now the file name is filtered, which solves the problem. I'm just wondering why. What can cause these problems in newer versions of Windows?
About the application: This is a mix of the local IIS installation in combination with the WIN32 client application. Basically, the reporting solution was designed as a web application, and a desktop application was created that previously used Word for reporting purposes. Some manager decided that it might be a good idea if the desktop application uses the logic of the web application to generate reports. And I admit: it was not a very bright idea ...
As a result, each user will run IIS on their system with a web application, while they also have a desktop application on the same computer. To make them communicate, a separate web service was created using C #, while the web application was created in classic ASP and desktop application in Delphi. The Desktop application will send the data through the local web service to the database, then run into the local web application to tell it to generate a report that it will download ...
Where everything goes wrong, in this coding Hell is not very clear. But since the file name is based on data from a desktop application that sometimes contains a colon, it sometimes creates ADS instead of the usual file name. In versions of Windows prior to Windows 7, it just seemed like it was working correctly. Files were written, and IIS will also serve them in a desktop application as PDF files. (And from there you can "save as" using the usual file name.
This application simply crashes on Windows 7 (64-bit) because it can write files to the ADS stream when a colon is added to the data, but it cannot restore them again. While we are filtering colons from the generated file names, I just wanted to know the possible causes of this problem. So this is a question out of curiosity ...
source share