Stream download to upload
@dylburger
code:
data:privatelast updated:6 months ago
today
Build integrations remarkably fast!
You're viewing a public workflow template.
Sign up to customize, add steps, modify code and more.
Join 200,000+ developers using the Pipedream platform
steps.
trigger
HTTP API
Deploy to generate unique URL
This workflow runs on Pipedream's servers and is triggered by HTTP / Webhook requests.
steps.
stream_download_to_upload
Downloads content at the Download URL, streams it to the Upload URL using an HTTP POST request
params
Download URL

The file you'd like to download

string ·params.downloadURL
Upload URL

The URL to which you'd like to upload the downloaded content (using an HTTP POST request)

string ·params.uploadURL
code
async params => {
1
2
3
4
5
6
7
8
9
10
11
12
}
13
const stream = require('stream');
const { promisify } = require('util');
const fs = require('fs');
const got = require('got');

const pipeline = promisify(stream.pipeline);

await pipeline(
  got.stream(params.downloadURL),
  got.stream.post(params.uploadURL)
);