Open ivarne opened 9 months ago
File name is assigned during the upload of the file. I gues you're looking a way to rename a file?
Yes that is the requested functionality.
The method in apps to call this API is named DataClient.Update(Instance, DataElement)
with description "Updates the data element metadata object."
One thing we would need to handle is changes to file extensions, maybe? DataType validation in regards to file types. defined in application metadata.
This api is for the application itself to update data elements. Not exposed to random users (I hope!). There are lots of worse ways to shoot yourself in the foot as an app developer.
A better way to fix this particular issue would be to allow app developers to modify the filename while uploading, but the main issue here is that it is confusing that this does not work.
FYI, the issue originated in eFormidling, where the solution was to create unique/new filenames for each attempt/shipment(?). This issue is still relevant, but more from an API completeness sense. Low pri, as there are no immediate usecases depending on this.
Description of the bug
The
DataElement.FileName
property seems to be not whitelisted as an allowed property herehttps://github.com/Altinn/altinn-storage/blob/e798be95adedfca6cf488347cbe2c89296e181b8/src/Storage/Controllers/DataController.cs#L458-L467
And the same for localtest
https://github.com/Altinn/app-localtest/blob/2200dd547233f56b88fffc0cdac7acbaa118b806/src/Controllers/Storage/DataController.cs#L447-L453
This seems weird.
Steps To Reproduce
Run code similar to this in an Altinn app
Additional Information
No response