Print Page | Close Window

Script to Browse and Add an Attachment

Printed From: Foxit's Planet PDF Forum
Category: Lets Talk PDF
Forum Name: JavaScript
Forum Description: Discussions relating to the use of JavaScript within PDF.
URL: http://forums.planetpdf.com/forum_posts.asp?TID=1171
Printed Date: 19 Aug 2019 at 2:31am
Software Version: Web Wiz Forums 11.10 - http://www.webwizforums.com


Topic: Script to Browse and Add an Attachment
Posted By: mhoney
Subject: Script to Browse and Add an Attachment
Date Posted: 11 Apr 2014 at 7:21am
Hi,

Hoping you might be able to be so kind as to suggest some script that allows a user to click a button, browse for a file and add it as an attachment.

I have an example that requires a user to put in the file name and path in some fields, but I don't know how to browse for a file without a user having to input this information (makes it easier for them).

Thanks for your help.Smile

  


-------------
Michael.



Replies:
Posted By: try67
Date Posted: 11 Apr 2014 at 9:34am
This code will prompt the user to select a file and will then attach that file to the PDF, under the given name ("Attachment1", in this case):

this.importDataObject({cName: "Attachment1"});


-------------
- Acrobat Expert - Contact me personally at try6767@gmail.com
Check out my custom-made scripts website: http://try67.blogspot.com


Posted By: mhoney
Date Posted: 12 Apr 2014 at 4:40am
Thanks for your help that is exactly what I need.

Michael.


-------------
Michael.


Posted By: Ragu
Date Posted: 06 Feb 2015 at 6:58pm
Hi
That was very helpful, now I know how to add a attachment button to PDF.
Could you please let me know what I can do to attach multiple files.
I could attach multiple files by clicking but they are not being saved.
Only the last attached file is saved
Thanks



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.10 - http://www.webwizforums.com
Copyright ©2001-2017 Web Wiz Ltd. - https://www.webwiz.net