User Tools

Site Tools


en:api_file_add

Help

https://cp.ahcdn.com/api2/file/manual?method=add

(use API credentials to see manual)

Examples

This example uses 'curl' utility but you can use any that you like .

curl -sS -u api_login:api_password -d location='http://domain.com/secretlink/1/2/345.mp4' -d name='1/2/543.mp4' -d size=1234567 http://cp.ahcdn.com/api2/file/add
  • location=http://domain.com/secretlink/1/2/345.mp4 - download URL. You can use password protection for the URL by adding login/password
    http://login:password@domain.com/secretlink/1/2/345.mp4
  • name='1/2/543.mp4' - full file name in CDN(with folders) . At this example file will be accessible as
cdn.domain.com/1/2/543.mp4

The file name in CDN does not have to match file name in download URL(location)

  • size=1234567 - file size in bytes. CDN compares this size with actual downloaded size after successful downloading. If specified and actual downloaded size doesn`t match - file is marked as 'failed' .
en/api_file_add.txt · Last modified: 2020/09/14 12:20 by psv