Skip to main content

Download File

This guide explains how to interact with the download API endpoint in the Calwe application.

Download File

Endpoint

  • Method: GET
  • URL: /v1/admin/download

Request Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes

Query Parameters

ParameterTypeDescriptionRequiredDefault
filestringFile path to downloadYesnull

Success Response

{
"success": true,
"message": "تم تحميل الملف بنجاح",
"data": {
"file_url": "download_url",
"file_name": "file_name.ext"
},
"statusCode": 200
}

Error Responses

File Not Found (404)

{
"success": false,
"message": "الملف غير موجود",
"data": null,
"statusCode": 404
}

Invalid File Path (422)

{
"success": false,
"message": "بيانات غير صحيحة",
"data": {
"file": [
"مسار الملف غير صحيح"
]
},
"statusCode": 422
}

Important Notes

File Download System

  • Secure file access through authenticated endpoints
  • Temporary download URLs generated
  • File path validation
  • Access control based on user permissions
  • File existence verification
  • Download tracking

Security Features

  • Authentication required for all downloads
  • File path sanitization
  • Access restrictions
  • Rate limiting applied
  • Download history tracking
  • Secure file storage

User Experience

  • Immediate download link generation
  • Clear error messages
  • Download progress tracking
  • File type validation
  • File size limits
  • Download retry support

Technical Details

  • Files served through secure storage
  • Temporary URLs expire after use
  • Download speed optimization
  • File integrity checks
  • Caching support
  • Error handling