I have a column (varbinary(max)) where I am storing PDF documents. So far, everything works fine. However, what I don’t like is that when the file is downloaded, it uses the row ID as the file name. After reading a bit, I started using the “File name field” and set it to another column I want to use instead. In this case, it’s a column with a GUID that is generated automatically, and it shows correctly.
The issue now is that when I click on the PDF, it downloads automatically without the .pdf extension in the file name. So, it shows the GUID name, for example: A2C3C8D8-A3D7-4D6B-AA5B-572793A0ED73. It should display: A2C3C8D8-A3D7-4D6B-AA5B-572793A0ED73.pdf, but it doesn’t. When it downloads, it saves the file as “File” type instead of as a PDF.
How can I fix this so that it uses the GUID column as the file name and includes the .pdf extension?
You should set a unique file name with extension to your File Name Field, i.e. “GUIDpdf”, for all records. After setting the File Name Field, you also need generate scripts again for that table.