How load config file on device from provision

Hi!
I load config file in server. In provision I can get parameters device. How load config file on device from provision?

https://docs.genieacs.com/en/latest/provisions.html#downloads

My provision running, but file not loaded.
It’s my provision:

let filename = "test.tar.gz"
declare("Downloads.[FileType:1 Firmware Upgrade Image]", {path: 1}, {path: 1});
declare("Downloads.[FileType:1 Firmware Upgrade Image].FileName", {value: 1}, {value: filename});
declare("Downloads.[FileType:1 Firmware Upgrade Image].Download", {value: 1}, {value: Date.now()});

or

declare("Downloads.[FileType:3 Firmware Upgrade Image]", {path: 1}, {path: 1});
declare("Downloads.[FileType:3 Firmware Upgrade Image].FileName", {value: 1}, {value: filename});
declare("Downloads.[FileType:3 Firmware Upgrade Image].Download", {value: 1}, {value: Date.now()});

It’s my files:

And it’s not work

declare("Downloads.[FileType:3 Vendor Configuration File", {path: 1}, {path: 1});
declare("Downloads.[FileType:3 Vendor Configuration File].FileName", {value: 1}, {value: filename});
declare("Downloads.[FileType:3 Vendor Configuration File].Download", {value: 1}, {value: Date.now()});

Probably because you are just copy and pasting code snippets without taking the time to understand what is going on. I suggest you look through all the logs and enable debug for the CPE in question and then look through the logs.

I used this privision:

event: incoming HTTP request
timestamp: 2023-10-11T09:10:03.977Z
remoteAddress: "::ffff:28.1.30.13"
deviceId: 000000-LNC%2D2101-65740300A2900003L
connection: 2023-10-11T09:10:03.918Z
localPort: 7547
method: POST
url: /
headers: 
  host: 10.9.128.158:7547
  accept: */*
  cookie: session=9eecad576d9c0612
  user-agent: cwmpd/1.0
  content-type: text/xml; UInt8set=utf-8
  soapaction: ""
  content-length: "1561"
  expect: 100-continue
body: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:cwmp=\"urn:dslforum-org:cwmp-1-0\"><SOAP-ENV:Header><cwmp:ID SOAP-ENV:mustUnderstand=\"1\">18b1e0015880002</cwmp:ID></SOAP-ENV:Header><SOAP-ENV:Body SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"><cwmp:GetParameterNamesResponse><ParameterList SOAP-ENC:arrayType=\"cwmp:ParameterInfoStruct[6]\" xsi:type=\"SOAP-ENC:Array\"><ParameterInfoStruct><Name>InternetGatewayDevice.LANDevice.LANHostConfigManagement.IPInterfaceNumberOfEntries.</Name><Writable>true</Writable></ParameterInfoStruct><ParameterInfoStruct><Name>InternetGatewayDevice.LANDevice.LANHostConfigManagement.1.</Name><Writable>true</Writable></ParameterInfoStruct><ParameterInfoStruct><Name>InternetGatewayDevice.LANDevice.LANHostConfigManagement.2.</Name><Writable>true</Writable></ParameterInfoStruct><ParameterInfoStruct><Name>InternetGatewayDevice.LANDevice.LANHostConfigManagement.3.</Name><Writable>true</Writable></ParameterInfoStruct><ParameterInfoStruct><Name>InternetGatewayDevice.LANDevice.LANHostConfigManagement.4.</Name><Writable>true</Writable></ParameterInfoStruct><ParameterInfoStruct><Name>InternetGatewayDevice.LANDevice.LANHostConfigManagement.5.</Name><Writable>true</Writable></ParameterInfoStruct></ParameterList></cwmp:GetParameterNamesResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>\r\n"
---
event: outgoing HTTP response
timestamp: 2023-10-11T09:10:03.984Z
remoteAddress: "::ffff:28.1.30.13"
deviceId: 000000-LNC%2D2101-65740300A2900003L
connection: 2023-10-11T09:10:03.918Z
statusCode: 204
headers: 
  content-length: 0
  server: GenieACS/1.2.7+20210919001756
  soapserver: GenieACS/1.2.7+20210919001756
  connection: close
body: ""

it’s log:

event: incoming HTTP request
timestamp: 2023-10-11T09:10:03.959Z
remoteAddress: "::ffff:28.1.30.13"
deviceId: 000000-LNC%2D2101-65740300A2900003L
connection: 2023-10-11T09:10:03.918Z
localPort: 7547
method: POST
url: /
headers: 
  host: 10.9.128.158:7547
  accept: */*
  cookie: session=9eecad576d9c0612
  user-agent: cwmpd/1.0
  content-type: text/xml; UInt8set=utf-8
  soapaction: ""
  content-length: "839"
body: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:cwmp=\"urn:dslforum-org:cwmp-1-0\"><SOAP-ENV:Header><cwmp:ID SOAP-ENV:mustUnderstand=\"1\">18b1e0015880001</cwmp:ID></SOAP-ENV:Header><SOAP-ENV:Body SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"><cwmp:GetParameterNamesResponse><ParameterList SOAP-ENC:arrayType=\"cwmp:ParameterInfoStruct[1]\" xsi:type=\"SOAP-ENC:Array\"><ParameterInfoStruct><Name>InternetGatewayDevice.LANDevice.LANHostConfigManagement.</Name><Writable>true</Writable></ParameterInfoStruct></ParameterList></cwmp:GetParameterNamesResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>\r\n"
---
event: outgoing HTTP response
timestamp: 2023-10-11T09:10:03.959Z
remoteAddress: "::ffff:28.1.30.13"
deviceId: 000000-LNC%2D2101-65740300A2900003L
connection: 2023-10-11T09:10:03.918Z
statusCode: 200
headers: 
  content-length: 622
  server: GenieACS/1.2.7+20210919001756
  soapserver: GenieACS/1.2.7+20210919001756
  content-type: text/xml; charset="utf-8"
body: >-
  <?xml version="1.0" encoding="UTF-8"?>

  <soap-env:Envelope xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:cwmp="urn:dslforum-org:cwmp-1-0"><soap-env:Header><cwmp:ID
  soap-env:mustUnderstand="1">18b1e0015880002</cwmp:ID></soap-env:Header><soap-env:Body><cwmp:GetParameterNames><ParameterPath>InternetGatewayDevice.LANDevice.LANHostConfigManagement.</ParameterPath><NextLevel>1</NextLevel></cwmp:GetParameterNames></soap-env:Body></soap-env:Envelope>
---
event: incoming HTTP request
timestamp: 2023-10-11T09:10:03.977Z
remoteAddress: "::ffff:28.1.30.13"
deviceId: 000000-LNC%2D2101-65740300A2900003L
connection: 2023-10-11T09:10:03.918Z
localPort: 7547
method: POST
url: /
headers: 
  host: 10.9.128.158:7547
  accept: */*
  cookie: session=9eecad576d9c0612
  user-agent: cwmpd/1.0
  content-type: text/xml; UInt8set=utf-8
  soapaction: ""
  content-length: "1561"
  expect: 100-continue
body: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:cwmp=\"urn:dslforum-org:cwmp-1-0\"><SOAP-ENV:Header><cwmp:ID SOAP-ENV:mustUnderstand=\"1\">18b1e0015880002</cwmp:ID></SOAP-ENV:Header><SOAP-ENV:Body SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"><cwmp:GetParameterNamesResponse><ParameterList SOAP-ENC:arrayType=\"cwmp:ParameterInfoStruct[6]\" xsi:type=\"SOAP-ENC:Array\"><ParameterInfoStruct><Name>InternetGatewayDevice.LANDevice.LANHostConfigManagement.IPInterfaceNumberOfEntries.</Name><Writable>true</Writable></ParameterInfoStruct><ParameterInfoStruct><Name>InternetGatewayDevice.LANDevice.LANHostConfigManagement.1.</Name><Writable>true</Writable></ParameterInfoStruct><ParameterInfoStruct><Name>InternetGatewayDevice.LANDevice.LANHostConfigManagement.2.</Name><Writable>true</Writable></ParameterInfoStruct><ParameterInfoStruct><Name>InternetGatewayDevice.LANDevice.LANHostConfigManagement.3.</Name><Writable>true</Writable></ParameterInfoStruct><ParameterInfoStruct><Name>InternetGatewayDevice.LANDevice.LANHostConfigManagement.4.</Name><Writable>true</Writable></ParameterInfoStruct><ParameterInfoStruct><Name>InternetGatewayDevice.LANDevice.LANHostConfigManagement.5.</Name><Writable>true</Writable></ParameterInfoStruct></ParameterList></cwmp:GetParameterNamesResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>\r\n"
---
event: outgoing HTTP response
timestamp: 2023-10-11T09:10:03.984Z
remoteAddress: "::ffff:28.1.30.13"
deviceId: 000000-LNC%2D2101-65740300A2900003L
connection: 2023-10-11T09:10:03.918Z
statusCode: 204
headers: 
  content-length: 0
  server: GenieACS/1.2.7+20210919001756
  soapserver: GenieACS/1.2.7+20210919001756
  connection: close
body: ""

And I change type file on 1m change provision on

let filename = "test.tar.gz"
declare("Downloads.[FileType:1 Firmware Upgrade Image]", {path: 1}, {path: 1});
declare("Downloads.[FileType:1 Firmware Upgrade Image].FileName", {value: 1}, {value: filename});
declare("Downloads.[FileType:1 Firmware Upgrade Image].Download", {value: 1}, {value: Date.now()});

And now no erros. But device not load file.
This is a log:

event: incoming HTTP request
timestamp: 2023-10-11T09:27:07.962Z
remoteAddress: "::ffff:28.1.30.13"
deviceId: 000000-LNC%2D2101-65740300A2900003L
connection: 2023-10-11T09:27:07.962Z
localPort: 7547
method: POST
url: /
headers: 
  host: 10.9.128.158:7547
  accept: */*
  user-agent: cwmpd/1.0
  content-type: text/xml; UInt8set=utf-8
  soapaction: ""
  content-length: "1945"
  expect: 100-continue
body: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:cwmp=\"urn:dslforum-org:cwmp-1-0\"><SOAP-ENV:Header><cwmp:ID SOAP-ENV:mustUnderstand=\"1\">4</cwmp:ID></SOAP-ENV:Header><SOAP-ENV:Body SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"><cwmp:Inform><DeviceId><Manufacturer>Normal</Manufacturer><OUI>000000</OUI><ProductClass>LNC-2101</ProductClass><SerialNumber>65740300A2900003L</SerialNumber></DeviceId><Event SOAP-ENC:arrayType=\"cwmp:EventStruct[1]\" xsi:type=\"SOAP-ENC:Array\"><EventStruct><EventCode>4 VALUE CHANGE</EventCode><CommandKey>ConfigRequest</CommandKey></EventStruct></Event><MaxEnvelopes>1</MaxEnvelopes><CurrentTime>2023-09-28T15:27:24Z</CurrentTime><RetryCount>0</RetryCount><ParameterList SOAP-ENC:arrayType=\"cwmp:ParameterValueStruct[6]\" xsi:type=\"SOAP-ENC:Array\"><ParameterValueStruct><Name>InternetGatewayDevice.ManagementServer.ConnectionRequestURL</Name><Value>http://28.1.30.13:7547</Value></ParameterValueStruct><ParameterValueStruct><Name>InternetGatewayDevice.DeviceInfo.SoftwareVersion</Name><Value>V1.0</Value></ParameterValueStruct><ParameterValueStruct><Name>InternetGatewayDevice.DeviceInfo.HardwareVersion</Name><Value>V1.0</Value></ParameterValueStruct><ParameterValueStruct><Name>InternetGatewayDevice.DeviceInfo.X_VENDOR_FEATURE_CODE</Name><Value>R1A_172_512M_HV1</Value></ParameterValueStruct><ParameterValueStruct><Name>InternetGatewayDevice.DeviceInfo.X_VENDOR_DEVICE_TYPE</Name><Value>FDD-LTE-Enterprise</Value></ParameterValueStruct><ParameterValueStruct><Name>InternetGatewayDevice.Services.FAPService.1.CellConfig.LTE.RAN.RF.X_VENDOR_PHY_CELL_ID</Name><Value>2</Value></ParameterValueStruct></ParameterList></cwmp:Inform></SOAP-ENV:Body></SOAP-ENV:Envelope>\r\n"
---
event: outgoing HTTP response
timestamp: 2023-10-11T09:27:07.963Z
remoteAddress: "::ffff:28.1.30.13"
deviceId: 000000-LNC%2D2101-65740300A2900003L
connection: 2023-10-11T09:27:07.962Z
statusCode: 200
headers: 
  content-length: 521
  server: GenieACS/1.2.7+20210919001756
  soapserver: GenieACS/1.2.7+20210919001756
  content-type: text/xml; charset="utf-8"
  set-cookie: session=4b29b73f382b680e
body: >-
  <?xml version="1.0" encoding="UTF-8"?>

  <soap-env:Envelope xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:cwmp="urn:dslforum-org:cwmp-1-0"><soap-env:Header><cwmp:ID
  soap-env:mustUnderstand="1">4</cwmp:ID></soap-env:Header><soap-env:Body><cwmp:InformResponse><MaxEnvelopes>1</MaxEnvelopes></cwmp:InformResponse></soap-env:Body></soap-env:Envelope>
---
event: incoming HTTP request
timestamp: 2023-10-11T09:27:07.970Z
remoteAddress: "::ffff:28.1.30.13"
deviceId: 000000-LNC%2D2101-65740300A2900003L
connection: 2023-10-11T09:27:07.962Z
localPort: 7547
method: POST
url: /
headers: 
  host: 10.9.128.158:7547
  accept: */*
  cookie: session=4b29b73f382b680e
  user-agent: cwmpd/1.0
  content-type: text/xml
  content-length: "0"
body: ""
---
event: outgoing HTTP response
timestamp: 2023-10-11T09:27:07.974Z
remoteAddress: "::ffff:28.1.30.13"
deviceId: 000000-LNC%2D2101-65740300A2900003L
connection: 2023-10-11T09:27:07.962Z
statusCode: 204
headers: 
  content-length: 0
  server: GenieACS/1.2.7+20210919001756
  soapserver: GenieACS/1.2.7+20210919001756
  connection: close
body: ""
---
event: incoming HTTP request
timestamp: 2023-10-11T09:27:08.018Z
remoteAddress: "::ffff:28.1.30.13"
deviceId: 000000-LNC%2D2101-65740300A2900003L
connection: 2023-10-11T09:27:08.018Z
localPort: 7547
method: POST
url: /
headers: 
  host: 10.9.128.158:7547
  accept: */*
  user-agent: cwmpd/1.0
  content-type: text/xml; UInt8set=utf-8
  soapaction: ""
  content-length: "1936"
  expect: 100-continue
body: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:cwmp=\"urn:dslforum-org:cwmp-1-0\"><SOAP-ENV:Header><cwmp:ID SOAP-ENV:mustUnderstand=\"1\">5</cwmp:ID></SOAP-ENV:Header><SOAP-ENV:Body SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"><cwmp:Inform><DeviceId><Manufacturer>Normal</Manufacturer><OUI>000000</OUI><ProductClass>LNC-2101</ProductClass><SerialNumber>65740300A2900003L</SerialNumber></DeviceId><Event SOAP-ENC:arrayType=\"cwmp:EventStruct[1]\" xsi:type=\"SOAP-ENC:Array\"><EventStruct><EventCode>4 VALUE CHANGE</EventCode><CommandKey>ConfigRequest</CommandKey></EventStruct></Event><MaxEnvelopes>1</MaxEnvelopes><CurrentTime>2023-09-28T15:27:24Z</CurrentTime><RetryCount>0</RetryCount><ParameterList SOAP-ENC:arrayType=\"cwmp:ParameterValueStruct[6]\" xsi:type=\"SOAP-ENC:Array\"><ParameterValueStruct><Name>InternetGatewayDevice.ManagementServer.ConnectionRequestURL</Name><Value>http://28.1.30.13:7547</Value></ParameterValueStruct><ParameterValueStruct><Name>InternetGatewayDevice.DeviceInfo.SoftwareVersion</Name><Value>V1.0</Value></ParameterValueStruct><ParameterValueStruct><Name>InternetGatewayDevice.DeviceInfo.HardwareVersion</Name><Value>V1.0</Value></ParameterValueStruct><ParameterValueStruct><Name>InternetGatewayDevice.DeviceInfo.X_VENDOR_FEATURE_CODE</Name><Value>R1A_172_512M_HV1</Value></ParameterValueStruct><ParameterValueStruct><Name>InternetGatewayDevice.DeviceInfo.X_VENDOR_DEVICE_TYPE</Name><Value>FDD-LTE-Enterprise</Value></ParameterValueStruct><ParameterValueStruct><Name>InternetGatewayDevice.Services.FAPService.1.CellConfig.LTE.RAN.RF.EARFCNDL</Name><Value>1825</Value></ParameterValueStruct></ParameterList></cwmp:Inform></SOAP-ENV:Body></SOAP-ENV:Envelope>\r\n"
---
event: outgoing HTTP response
timestamp: 2023-10-11T09:27:08.020Z
remoteAddress: "::ffff:28.1.30.13"
deviceId: 000000-LNC%2D2101-65740300A2900003L
connection: 2023-10-11T09:27:08.018Z
statusCode: 200
headers: 
  content-length: 521
  server: GenieACS/1.2.7+20210919001756
  soapserver: GenieACS/1.2.7+20210919001756
  content-type: text/xml; charset="utf-8"
  set-cookie: session=7b0895353d7529b3
body: >-
  <?xml version="1.0" encoding="UTF-8"?>

  <soap-env:Envelope xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:cwmp="urn:dslforum-org:cwmp-1-0"><soap-env:Header><cwmp:ID
  soap-env:mustUnderstand="1">5</cwmp:ID></soap-env:Header><soap-env:Body><cwmp:InformResponse><MaxEnvelopes>1</MaxEnvelopes></cwmp:InformResponse></soap-env:Body></soap-env:Envelope>
---
event: incoming HTTP request
timestamp: 2023-10-11T09:27:08.027Z
remoteAddress: "::ffff:28.1.30.13"
deviceId: 000000-LNC%2D2101-65740300A2900003L
connection: 2023-10-11T09:27:08.018Z
localPort: 7547
method: POST
url: /
headers: 
  host: 10.9.128.158:7547
  accept: */*
  cookie: session=7b0895353d7529b3
  user-agent: cwmpd/1.0
  content-type: text/xml
  content-length: "0"
body: ""
---
event: outgoing HTTP response
timestamp: 2023-10-11T09:27:08.029Z
remoteAddress: "::ffff:28.1.30.13"
deviceId: 000000-LNC%2D2101-65740300A2900003L
connection: 2023-10-11T09:27:08.018Z
statusCode: 204
headers: 
  content-length: 0
  server: GenieACS/1.2.7+20210919001756
  soapserver: GenieACS/1.2.7+20210919001756
  connection: close
body: ""

Is there a working example with uploading files?