Forum Discussion
Uploading SKCS 12 File to F5 Device
I have been stuck on trying to upload an SKCS 12 file to an F5 device. A regular cert works and other files have worked as well but I constantly get an issue "Chunk byte count 7611 in Content-Range header different from received buffer length 11616" despite me having the correct Content-Range calculation. I am currently on python and am posting to
/mgmt/shared/file-transfer/uploads/{file_name}
I would appreciate the help greatly, thank you
to update device certs ---> Changing the BIG-IP system device certificate using the Configuration utility (f5.com)
if updating the certificate system bundle :
make sure you make a backup as any corruption on this file can impact system communications
vi /config/ssl/ssl.crt/ca-bundle.crt
- Jeffrey_GranierEmployee
to update device certs ---> Changing the BIG-IP system device certificate using the Configuration utility (f5.com)
if updating the certificate system bundle :
make sure you make a backup as any corruption on this file can impact system communications
vi /config/ssl/ssl.crt/ca-bundle.crt
- Jeffrey_GranierEmployee
Have you tried to use Content-Range: bytes 0-11615/total_file_size in your python script ? Is there any encoding happening before the upload? If so double check the encoded length matches what your using in the headers
- cheluscoAltostratus
chunk_size = 512 * 1024 # 512 KB chunk size for uploading
def upload_file(file_data, file_name):
total_size = len(file_data)
url = f'https://{f5_ip}/mgmt/shared/file-transfer/uploads/{file_name}'
start = 0
response = None
while start < total_size:
end = min(start + chunk_size, total_size)
file_slice = file_data[start:end]
content_range = f"{start}-{end - 1}/{total_size}"
print("Content Range: ", content_range)
upload_headers['Content-Range'] = content_range
response = requests.post(url, headers=upload_headers, data=file_slice, verify=False)
if response.status_code != 200:
print(f"Error during upload: {response.text}")
break
start = end
print("Response: ", response.text)
this is currently what I have been using, should I change it? I wanted it to be able to upload any type of file- Jeffrey_GranierEmployee
You can try to specify the sizes in the content header considering your error returning provided values back.
content_range = 0-7611
also have you tried to specify the exact chunk value?
chunk_size = 7611 # Define the size of the chunks
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com