Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uploading files to an AAS does not update the underlying package #171

Open
HansG89 opened this issue Mar 21, 2023 · 1 comment
Open

Uploading files to an AAS does not update the underlying package #171

HansG89 opened this issue Mar 21, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@HansG89
Copy link

HansG89 commented Mar 21, 2023

Branch: masterV3

When using the REST API to upload attachments or thumbnails into an existing AAS this does not update the underlying package.
We always need to download the package and afterwards upload it again (using the PUT /packages/{packageID} endpoint) to make the changes permanent.

Is this the intendend behaviour or should adding files via REST API automatically update the stored AASX package?

Edit:

There is a bug when editing an AASX with the PUT package endpoint after a change was done to the original AASX file.
I think a proper fix should be changing this line

https://github.com/admin-shell-io/aasx-server/blob/3abf7f1817bf5118293e1b2b7daddb864b1fac71/src/IO.Swagger.V1RC03/Services/AasxFileServerInterfaceService.cs#L194

into this

var originalFile = _envFileNames[packageIndex];
@MMuellerMitsubishi
Copy link

We are having the same issue at the moment when using the AASX Server. We want to create an AAS via the API. And then upload a file to one of its submodel elements via the PUT /attachment/ endpoint. It works only with some work arounds

This flow doesn't work:

  • Create new AAS and Submodel for this AAS via the API
  • PUT /attachment to one of it File submodel elements -> Return 204, seems to be OK
  • GET /attachment to check if the file is really on the sever -> fails

This flow works:

  • Create new AAS and Submodel for this AAS via the API
  • Download the AASX file of this created AAS e.g. via Blazor UI or GET /packages/{packageID} endpoint
  • PUT /attachment to one of it File submodel elements -> Return 204
  • GET /attachment to check if the file is really on the sever -> Now the download works

But as described above the underlying AASX file in the server is not updated.

To update it we need to do another workaround.

  • Download the AASX file via Blazor UI or GET /packages/{packageID} endpoint
  • the downloaded AASX file contains the previously uploaded file (PUT /attachment)
  • Upload the AASX file to the server by using the PUT /packages/{packageID} endpoint

Now the underlying AASX file on the server is updated.

Working with attachments on AAS created via the API should be supported and the underlying AASX files should be updated also directly.

@juileetikekar juileetikekar added the enhancement New feature or request label Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants