Skip to main content
โ† Back to API Practice

๐Ÿ“ File Operations Lab

Practice file download and upload testing. Learn to handle CSV, JSON, PDF, ZIP files, Range headers for resume downloads, and chunked transfer encoding.

9
Total Challenges
2
Easy
3
Medium
4
Hard/Expert

๐Ÿ“ฆ Available File Formats

CSV

Comma-separated values. Easy to parse, widely supported.

Content-Type: text/csv

JSON

JavaScript Object Notation. Structured, nested data.

Content-Type: application/json

PDF

Portable Document Format. Binary format, needs parsing library.

Content-Type: application/pdf

ZIP

Compressed archive. Contains multiple files.

Content-Type: application/zip

Large Binary

Supports Range headers for resume downloads.

Accept-Ranges: bytes

Stream

Chunked transfer encoding for unknown size.

Transfer-Encoding: chunked

โšก Quick Test

Difficulty:

Download CSV File

EASY

Download a CSV file and verify its Content-Type header and data structure. Learn to parse CSV and validate the content.

/api/v1/files/download?format=csv&rows=10&type=users

Download JSON File

EASY

Download a JSON file and validate its structure using JSON Schema or manual assertions.

/api/v1/files/download?format=json&rows=5&type=products

Download PDF Document

MEDIUM

Download a PDF file and verify its size, Content-Disposition header, and basic PDF structure.

/api/v1/files/download?format=pdf&rows=10

Download ZIP Archive

MEDIUM

Download a ZIP archive containing multiple files. Extract and verify the contents.

/api/v1/files/download?format=zip

Range Request (Resume Download)

HARD

Implement partial file download using Range headers. This enables resume functionality for interrupted downloads.

/api/v1/files/download?format=large&size=1

Streaming Download

HARD

Handle large file downloads with streaming. Monitor progress and handle backpressure.

/api/v1/files/download?format=large&size=5

Content-Disposition Header

MEDIUM

Test Content-Disposition header parsing. Verify filename extraction including special characters and encoding.

/api/v1/files/download?format=csv

Chunked Transfer Encoding

EXPERT

Handle Transfer-Encoding: chunked responses where Content-Length is not known in advance.

/api/v1/files/download?format=stream

Resumable Upload (tus-style)

EXPERT

Upload a file in chunks, survive an interruption, and resume from the server-reported offset instead of starting over.

/api/v1/upload/resumable
Showing 9 of 9 challenges

๐Ÿ’ป Quick Start

curl

# Download CSV
curl -O /api/v1/files/download?format=csv

# Resume download with Range
curl -C - -O /api/v1/files/download?format=large&size=5

Playwright

// Download file
const [download] = await Promise.all([
  page.waitForEvent('download'),
  page.click('#download-btn'),
]);
const path = await download.path();