This repository contains demo projects showcasing how to use the ScreenApp API for multipart file uploads in different programming languages.
- Node.js/TypeScript - Located in the
nodeJS/folder - Python - Located in the
python/folder
- For Node.js: Node.js (v20 or higher)
- For Python: Python (v3.8 or higher)
- A ScreenApp account with authentication token
- Your ScreenApp Team ID and Folder ID
The Node.js example demonstrates two different file upload methods using TypeScript:
- Simple Upload (
src/upload.ts) - For smaller files using a single upload request - Multipart Upload (
src/multipart-upload.ts) - For larger files using chunked upload
- Navigate to the Node.js example:
cd nodeJS - Install dependencies:
npm install
- Copy the environment variables file:
cp env.example .env
- Update the
.envfile with your ScreenApp credentials
For simple upload (recommended for smaller files):
npm run uploadFor multipart upload (recommended for larger files):
npm run multipart-uploadThe simple upload (upload.ts) follows this process:
- Request an upload URL from the API
- Upload the file directly to the received URL
- Finalize the upload with metadata
The multipart upload (multipart-upload.ts) follows this process:
- Initialize a multipart upload session
- Upload the file in 5MB chunks
- Finalize the multipart upload
The Python example provides two upload methods:
- Simple Upload (
upload.py) - For smaller files using direct upload - Multipart Upload (
multipart-upload.py) - For larger files using chunked upload
- Navigate to the Python directory:
cd python - Install dependencies:
pip install -r requirements.txt
- Copy the environment file:
cp .env.example .env
- Update the
.envfile with your ScreenApp credentials
Simple Upload:
python src/upload.pyMultipart Upload:
python src/multipart-upload.pyThe simple upload is suitable for smaller files, while multipart upload is recommended for larger files as it uploads in chunks for better reliability.
Both examples require the same environment variables:
AUTHENTICATION_TOKEN- Your ScreenApp authentication tokenTEAM_ID- Your ScreenApp team IDFOLDER_ID- The folder ID where you want to upload filesFILE_PATH- Absolute path to the video file you want to upload
Simple Upload demonstrates:
- Requesting an upload URL from the ScreenApp API
- Uploading the file directly to the presigned URL
- Finalizing the upload process
Multipart Upload demonstrates:
- Validating environment configuration
- Initializing a multipart upload session with the ScreenApp API
- Uploading a video file in 5MB chunks
- Finalizing the upload process
Both examples will upload the file specified in FILE_PATH to your ScreenApp account.
nodeJS/
├── package.json
├── tsconfig.json
├── env.example
└── src/
├── upload.ts # Simple upload implementation
├── multipart-upload.ts # Multipart upload implementation
└── config.ts # Configuration and validation utilities
python/
├── requirements.txt
├── .env.example
└── src/
├── upload.py # Simple upload implementation
└── multipart-upload.py # Multipart upload implementation