Version: eXtendFiles 1.9.0 and above
Audience: Administrator

Overview

You can set up a NetSuite workflow that generates a signed URL for an eXtendFiles record automatically, so you don't have to create links manually. The workflow uses the eXtendFiles Generate Signed URL workflow action and saves the link in the eXtendFiles - Pre-signed URL field on the eXtendFiles record.

In this article, you build a workflow that generates a signed URL when an eXtendFiles record is created. It also runs when an existing record is edited, but only creates a signed URL if the eXtendFiles - Pre-signed URL field is empty. The example only runs for files with a File Type of Production Proof, and the signed URL stays valid for 90 days.

For details on every parameter of the workflow action, see Generating eXtendFiles Signed Link/URL via Workflow.

Prerequisites

Note: If your files are stored in Microsoft SharePoint/OneDrive, use the eXtendFiles OneDrive Sharing URL workflow action instead. See Generating eXtendFiles Shared Link/URL via Workflow (SharePoint/OneDrive).

Configuration

Create the workflow

  1. Go to Customization → Workflow → Workflows → New.
  2. Enter a Name for the workflow, such as eXtendFiles Auto Generate Signed Url.
  3. In Record Type, select eXtendFiles.
  4. Set Release Status to Released.
  5. Under Initiation, select Event Based.
  6. Under Event Definition check On Create and On View Or Update.
  7. In Trigger Type, select Before Record Submit.
  8. In Event Type, select Create and Edit.
Image Placeholder

Add the workflow condition

The condition makes sure the workflow only runs for records that have a file but don't have a signed URL yet.

  1. Next to Condition, open the condition builder.
  2. Add these three conditions:
    • eXtendFiles - URL is not empty
    • eXtendFiles - Pre-signed URL is empty
    • eXtendFiles - File Type (Custom) = Production Proof
  3. Click Save to save the condition, then click Save to save the workflow.
Image Placeholder

Note: Production Proof is an example. Select the file type you want signed URLs for, or remove the file type condition to generate signed URLs for all file types.

Add the signed URL action

  1. In the workflow diagram, click State 1.
  2. On the Actions subtab, click New Action, then select eXtendFiles Generate Signed URL (Custom).
  3. In Trigger On, select Entry.
  4. In Contexts, select all contexts.
  5. Image Placeholder
  6. Under Parameters, set these values:
    • Validate user for generation: unchecked
    • Generate Signed Preview URL: unchecked
    • Generate Thumbnail Signed URL: unchecked
    • Do Not Generate Original File Signed URL: unchecked
    • Signed URL Validity (Seconds): 90 days
  7. Image Placeholder
  8. Click Save.

Test the workflow

  1. Upload a file and set its File Type to Production Proof.
  2. Open the new eXtendFiles record and confirm the eXtendFiles - Pre-signed URL field has a link.

  3. If the field is empty, check the Pre-Signed URL Generation Error field for the reason.

Frequently Asked Questions (FAQs)

Q: Why does the workflow also run on view or update?
A: This lets the workflow add a signed URL to records that existed before you created the workflow, the next time you edit them. Because the workflow only runs when eXtendFiles - Pre-signed URL is empty, a record that already has a signed URL isn't changed.

Q: What happens when the signed URL expires?
A: The link stops working after 90 days. The workflow won't create a new one automatically, because the eXtendFiles - Pre-signed URL field isn't empty. To get a new link, clear the field and save the record or you can have the workflow check the Pre-Signed URL Expiry Time field, which shows when the current link expires. Change the condition so the workflow runs when eXtendFiles - Pre-signed URL is empty or Pre-Signed URL Expiry Time is in the past. The workflow then replaces an expired link the next time it runs on that record.

Q: Can I also generate signed URLs for the preview and thumbnail images?
A: Yes. Check Generate Signed Preview URL or Generate Thumbnail Signed URL in the action parameters. If MAKE THUMBNAIL PRIVATE is checked on the eXtendFiles Configuration page and you use Amazon S3, you need the thumbnail signed URL.

Q: Why isn't a signed URL generated in my sandbox?
A: Signed URL generation is turned off by default in sandbox and release preview accounts. Turn on ALLOW FILE MIGRATION/CONVERSION IN SANDBOX & RP ACCOUNTS on the eXtendFiles Configuration page.

Q: How do I choose a different validity period?
A: You can enter a number of seconds in Signed URL Validity (Seconds). For example, 1 day is 86400 and 30 days is 2592000. You can also enter a number of days, such as 90 Days. We recommend keeping the validity period as short as your use case allows. If you leave Signed URL Validity (Seconds) empty, eXtendFiles uses Expiry time for private URLs from the eXtendFiles Configuration page.

Image Placeholder