> ## Documentation Index
> Fetch the complete documentation index at: https://docs.realitydefender.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AWS Presigned URL

<ParamField body="fileName" type="string">
  The file name of the file you would like to upload, including the file extension.
</ParamField>

Before uploading a file directly to our storage, you'll need to request a pre-signed URL. This URL provides secure, temporary access to upload your file.

### Authorization

To request a pre-signed URL, you must include the `x-api-key` in your request headers. This key is essential for authenticating your request and ensuring secure access to the API.

### Supported File Types

* Documents: `.pdf`, `.doc`, `.docx`, `.txt`
* Images: `.jpg`, `.jpeg`, `.png`, `.gif`, `.webp`
* Audio: `.mp3`, `.wav`, `.m4a`, `.aac`, `.ogg`, `.flac`, `.alac`
* Video: `.mp4`, `.mov`
* Text: `.txt`

### Size Limits

* Documents: up to 5MB
* Images: up to 50MB
* Audio: up to 20MB
* Video: up to 250MB

### Filename Restrictions

* Maximum length: 200 characters
* Special characters will be converted to underscores
* Case insensitive

### Sample Code Snippet

Here's an example of how you can request a pre-signed URL and upload a file.

<CodeGroup>
  ```bash curl theme={null}
  # First request to get the presigned URL
  curl -X POST \
    'https://api.prd.realitydefender.xyz/api/files/aws-presigned' \
    -H 'X-API-KEY: your-api-key-here' \
    -H 'Content-Type: application/json' \
    -d '{"fileName": "your-file.mp4"}'

  # Second request to upload the file using the presigned URL
  # Important: The @ prefix is required before the filename when using --data-binary
  # This tells curl to read the file content (works on all platforms: macOS, Linux, Windows)
  # For filenames with spaces or special characters, wrap the entire @filename in quotes
  curl -X PUT \
    'presigned-url-from-previous-response' \
    --data-binary '@your-file.mp4'

  # Example with a filename containing spaces:
  # curl -X PUT 'presigned-url-from-previous-response' \
  #   --data-binary '@filename with spaces.mp4'
  ```

  ```python python theme={null}
  import requests 

  file_path = "your-file.mp4"
  url = "https://api.prd.realitydefender.xyz/api/files/aws-presigned"
  payload = {
      "fileName": file_path
  }
  headers = {
      "X-API-KEY": "your-api-key-here",
      "Content-Type": "application/json"
  }
  response = requests.post(url, json=payload, headers=headers)  
  response_data = response.json()  
  signed_url = response_data.get("response", {}).get("signedUrl") 
  with open(file_path, 'rb') as file:
      file_data = file.read()
  response = requests.put(signed_url, data=file_data, timeout=20)
  ```
</CodeGroup>
