0 votes
in Rock by MarissaEubanks (4.0k points)
edited

Has anyone renamed files as they were downloaded as to not show either the name that they were uploaded as, or in sequential order (i.e. document1, document2, etc.)? But, rather to include the registration, registrant, and/or person name in the file name?

This is related to THIS question.

2 Answers

+1 vote
by DavidTurner (14.9k points)
edited
 
Best answer

Our custom GetFiles.ashx handler that we (Pillars/9 Embers) developed also currently works just like the core GetFile.ashx handler. The C# code in that handler adds files to the zip file based on the nameĀ of that file that was used when it was uploaded (the name in the BinaryFile table). It does check for duplicate names and handles that by adding an incremental number at the end of the file name. Because its custom though, we could update it. For example, if an entity list of people, registrations, or registrants is passed to the handler, it could rename the files being downloaded to be the name of those entities. That would just take some development time to do (a couple hours).

+1 vote
by MarkLee (8.3k points)
edited

It looks like /GetFile.ashx will return the file name saved in the Binary File table. If you want to pick the filename, I believe you will need to set the FileName of the binary file either when it's saved, or after the fact with SQL.

Welcome! Here you can ask questions and receive answers (hopefully) from other members of our team.
...