Can i modify the file name on attachment via script? | Community
Skip to main content
Level 4
July 10, 2023
Solved

Can i modify the file name on attachment via script?

  • July 10, 2023
  • 2 replies
  • 1000 views

Good morning everyone 🙂

 

I was wondering if i could via script, change the name of the PDF file that is created when i use the submit button and it attaches the current PDF into an email.

 

Something like a name + date:: 2023-01-25_FN LN.PDF

And just in the hopes this helps, i use the following script to fire off the said email:

event.target.submitForm({cURL: cEmailURL,cSubmitAs:"PDF",cCharSet:"utf-8"});

 

Thx again for the help, this would be awesome if its doable.

 

PAtrick

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Vijay_Katoch

Didn't find any parameter to pass the custom file name.

There is one property 'documentFileName', see if you can do something with this.

If you do :

app.alert(event.target.documentFileName); -> it will give the current file name.

I think something need to be done with documentFileName property.

2 replies

Vijay_Katoch
Community Advisor
Vijay_KatochCommunity AdvisorAccepted solution
Community Advisor
July 12, 2023

Didn't find any parameter to pass the custom file name.

There is one property 'documentFileName', see if you can do something with this.

If you do :

app.alert(event.target.documentFileName); -> it will give the current file name.

I think something need to be done with documentFileName property.

Level 4
July 12, 2023

sounds good, i will take a look at that property.

 

thx a lot 🙂

radzmar
Level 10
September 27, 2023

It's not possible to change the name of the attached file via script. You'll have to save the document under the desired name before sending it.