I am trying to upload a .rvt to BIM360 docs. I can successfully get through step 5 in this link, but once I get there, things go wrong. If I upload a .zip or some other format, I can get through step 6. If I try a .rvt, the response tells me that 'processState': 'NEEDS_PROCESSING', and the publish log in BIM360 Docs says 'Extraction Failed'. I've tried multiple .rvt files of varying sizes, and it's always the same. If I try to upload using the '/resumable' PUT request, it fails as well. Any help would be appreciated. Relevant code:
def read_file_chunks(open_file, chunk_size = 3145728):
while True:
data = open_file.read(chunk_size)
if not data:
break
yield data
def upload_to_storage(bucket_key, object_name, filepath, filename):
upload_url = forge_base + forge_bucket + '/' + bucket_key + '/objects/' + urllib.parse.quote(object_name) + '/resumable'
bare_token3 = token3.get('Authorization')
session_id = uuid.uuid1()
upload_file = filepath + filename
file_size = os.path.getsize(upload_file)
open_file = open(upload_file, 'rb')
index = 0
for chunk in read_file_chunks(open_file):
offset = index + len(chunk)
print (offset)
content_type = 'application/octet-stream'
content_length = str(file_size)
print (content_length)
content_range = 'bytes %s=%s/%s'% (index, offset, file_size)
print (content_range)
index = offset
upload_header = {'Authorization': bare_token3, 'Content-Type': content_type, 'Content-Length': content_length, 'Content-Range': content_range, 'Session-Id': str(session_id)}
print (upload_header)
upload_response = requests.put(upload_url, headers=upload_header, data=chunk)
print (upload_response)
return upload_response.json()