This topic was automatically generated from Slack. You can find the original thread here.
does pipedream have a facility for temporarily hosting a file at a public URL? I want to upload a file to Airtable, but this needs the file to be hosted at an accessible URL. Before I do the upload, I am receiving a PDF file back from Browserless in the body of an API response.
Pipedream does not have a built-in facility for temporarily hosting files at a public URL. However, you can use a third-party service like Amazon S3, Google Cloud Storage, or any other file hosting service to temporarily store your file and generate a public URL for it. Since you’re working with Browserless, you can use the following example component to generate a screenshot and store it in a third-party service: ```
import puppeteer from ‘puppeteer-core@14.1.0’; export default defineComponent({ props: { browserless: { type: “app”, app: “browserless”, }, }, async run({ steps, $ }) { const browser = await puppeteer.connect({ browserWSEndpoint: wss://chrome.browserless.io?token=${this.browserless.$auth.api_key} }); const page = await browser.newPage(); const url = “https://example.com”; const type = “png”; await page.goto(url); const screenshot = await page.screenshot(); // Save the screenshot to a third-party service and generate a public URL // Then, use the public URL to upload the file to Airtable await browser.close(); }, });
not between executions, so you would need to persist the file somewhere. But since the workflow can have multiple triggers, you can do something like this:
Email → write file
HTTP → get file → issue HTTP response
Technically you can write the file to /tmp but that’s local to the container and the data may be cleared across executions
yeah I agree, it may be cleaner to separate. Technically we expose the trigger in steps.trigger.context.emitter_id but as you mentioned, it’s an ID so it’s a little odd to handle the conditional logic from that