Export to PDF with File name field

Hello everyone,

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?

Your file name field should store a file name with extension, not just GUID.

What are you mean with “file name with extension”?

You mean concatenade mi GUID + “.pdf”?

yes, append the extension to your filename

Ok, this actually work to show the GUID.pdf, but now, how can I replace the name of the file for the GUID, when I download the pdf?

Concatenade works.

But the file name when I download still show me the ID column
image

That 3 its the ID, i want to replace to my GUID column

And this is my settings con phpmaker

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.