Documentation Index Fetch the complete documentation index at: https://intunedhq.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Downloads a file from a web page and automatically uploads it to AWS S3 storage in a single operation.
Combines downloadFile (for trigger methods) and uploadFileToS3
(for S3 configuration), providing a streamlined workflow for capturing and storing files.
export declare function saveFileToS3 ( input : {
page : Page ;
trigger : Trigger ;
timeoutInMs ?: number ;
configs ?: S3Configs ;
fileNameOverride ?: string ;
contentType ?: string ;
}) : Promise < Attachment >;
Examples
URL Trigger
Locator Trigger
import { saveFileToS3 } from "@intuned/browser" ;
import { BrowserContext , Page } from "playwright" ;
interface Params {}
export default async function handler (
params : Params ,
page : Page ,
context : BrowserContext
) {
const uploadedFile = await saveFileToS3 ({
page ,
trigger:
"https://intuned-docs-public-images.s3.amazonaws.com/27UP600_27UP650_ENG_US.pdf" ,
configs: {
bucket: "document-storage" ,
region: "us-east-1" ,
accessKeyId: "accessKeyId" ,
secretAccessKey: "SecretAccessKeyId" ,
},
fileNameOverride: "reports/monthly-report.pdf" ,
});
return { file: uploadedFile };
}
Arguments
Configuration object for the download and upload operation The Playwright Page object to use for downloading
The Trigger method to initiate the download Maximum time in milliseconds to wait for download to start. Defaults to 5000.
Optional S3Configs to customize the S3 upload.
If not provided, uses environment variables (AWS_ACCESS_KEY_ID,
AWS_SECRET_ACCESS_KEY, AWS_REGION, AWS_ENDPOINT_URL, AWS_BUCKET). If
environment variables aren’t set, uses default Intuned S3 settings. Optional custom filename for the uploaded file. If not provided, uses the
original filename or generates a unique name.
Optional MIME type for the uploaded file (e.g., “application/pdf”,
“image/png”).
Returns: Promise<Attachment>
Promise that resolves to an Attachment object with file metadata and S3 utilities