cancel
Showing results for 
Search instead for 
Did you mean: 

How to update files with RES Api

0 Kudos

Hello SAP experts,

at the moment we have the following use case. We want to automatically upload a file to our SAP BO 4.2/4.3 frontend.

We already developed solutions for downloading reports or uploading files.

E.g. we have a function for upload

def file_upload(host: str, logon_token: str, folder_id: str, filename: str):
    document_url = f"http://{host}:6405/biprws/infostore/folder/{folder_id}/file"
    files = {'file': open(filename, 'rb')}     headers = {"X-SAP-LogonToken": logon_token}     
    res = requests.post(document_url, headers=headers, files=files)     
    res.raise_for_status()
    return res.content

With this we want to create a webi Report that uses this file as a source.

The problem is that a repitition of the function dont update/replace the file instead it creates an additional file like file.xlsx + file[1].xlsx ...

We could delete and reupload the file but this destroys the internal file id and the depending webi report cannot be updated.

So i hope you understand my situation and have some idea. I expect that there is another type of requests that replaces a file correctly but i couldnt find such a thing in the documetation.

Best,

Patrick

denis_konovalov
Active Contributor
0 Kudos

I have fixed your tag. Please select more careful next time

Accepted Solutions (0)

Answers (0)