Create a file in S3 (Bun)

Details on S3 integration at https://www.windmill.dev/docs/core_concepts/persistent_storage/large_data_files

Script s3 Verified

by henri186 ยท 3/13/2024

The script

Submitted by henri186 Bun
Verified 385 days ago
1
import * as wmill from 'windmill-client';
2
import { S3Object } from 'windmill-client';
3

4
export async function main(s3_file_path: string) {
5
	const s3_file_output: S3Object = {
6
		s3: s3_file_path
7
	};
8

9
	const file_content = 'Hello Windmill!';
10
	// file_content can be either a string or ReadableStream<Uint8Array>
11
	await wmill.writeS3File(s3_file_output, file_content);
12
	return s3_file_output;
13
}
Other submissions
  • Submitted by jansteinark898 Bun
    Created 432 days ago
    1
    import * as wmill from 'windmill-client';
    2
    import { S3Object } from 'windmill-client';
    3
    
    
    4
    export async function main(s3_file_path: string, file_content: string) {
    5
    	const s3_file_output: S3Object = {
    6
    		s3: s3_file_path
    7
    	};
    8
    
    
    9
    	// file_content can be either a string or ReadableStream<Uint8Array>
    10
    	await wmill.writeS3File(s3_file_output, file_content);
    11
    	return s3_file_output;
    12
    }