-
Notifications
You must be signed in to change notification settings - Fork 29
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
File uploaded resources of type application/zip not working #457
Comments
I have tested the functionality to upload zip files with a python script that puts the file in the DSC. It worked fine. |
There might be a problem with how the DSC encodes the binary files. I have compared the binaries of an original zip file and the artifact data from the DSC and they are different. |
Persisting a ZIP file with the DSC UI produces a corrupt ZIP file. The file that is returned on request is bigger than the original file, which means they can't be possibly equal. I believe 1) some zip file headers are maybe persisted as well instead of only the file or 2) the file is persisted in a different encoding. I've been experimenting with different results and managed to write a method where the content length doesnt change on output, but didnt reach a solution where the zip file is not corrupt. There is also the possibility that the frontend is encoding the files before sending it to the DSC. A possible consideration could be to create a separate endpoint for zip file handling. Part of the problem is that the DSC handles all input files the same (all use the same REST endpoint). It might make it easier to handle ZIP files differently than normal files. Storing the whole file content in one database entry also doesnt seem to be the best practice. I'll keep looking for alternatives. |
It could be due to the UI, there the method [1] https://github.com/International-Data-Spaces-Association/DataspaceConnectorUI/blob/a723eb0109283a219f5b273d25c30a1ee7cf4793/src/pages/dataoffering/resources/addresource/representation/ResourceRepresentationPage.js#L129 |
-> Opening the downloaded zip file fails. It is not recognized as a zip file
The text was updated successfully, but these errors were encountered: