Store File Content Directly: Avoid Expired Links from Cloud Services
Many of us automate processes that involve files from cloud services, such as invoices from Stripe. Often, these services provide you a temporary download link. This link works well initially, but the link will expire, sooner or later. If your workflow relies on these links, your stored data will sooner or later become inaccessible.
The Problem: Temporary File Links
Services like Stripe provide temporary URLs to download files. After a certain period, these links stop working. This is primarily due to security and resource management.
Security: Temporary links reduce the risk of unauthorized access to sensitive data. By invalidating links, Stripe minimizes the window of opportunity for malicious actors to intercept or share invoice URLs.
Resource Management: Storing files indefinitely would consume significant server space. By generating temporary links, Stripe optimizes resource usage and reduces storage costs.
Because of these reasons, if you only save these links, you will lose access to the files.
The Solution: Retrieve and Save the File
Instead of storing the link, you:
Download the file: Use zenphi's HTTP Request action to get the file data (a.k.a. payload) on any cloud service by using the URL.
Save the file: Use zenphi's storage actions (e.g., Google Drive, SharePoint, or store it in a zenphi table) to save the actual file data.
Example: Saving a Stripe Invoice to a Contract in a Contracts Table
Let's look at a Stripe invoice as an example.
Trigger: Your workflow starts when a new Stripe invoice is created.
Get Invoice Details: Use the Stripe connector to retrieve the invoice details. This includes the invoice_pdf url: something like this; "https://pay.stripe.com/invoice/xxxxxxxxxxxxx/xxxxxxxxxxxxx/pdf?s=ap"
HTTP Request: Add an HTTP Request action to your flow.
URL: Use the invoice_pdf url you get from the trigger.
Method: GET.
Indicate the response is a file.
Default Content Type: application/pdf.
Default Filename: provide a name that makes sense to you.
4. Save the File: In this case, add the file to the contact in the Contracts table.
You could also save to Google Drive, DropBox, OneDrive, etc.
Why This Is ImportantData Preservation: You keep the actual file, not just a temporary link.
Compliance: For audits or legal reasons, having the original file is essential.
Reliability: Your workflows will not break because of expired links.