Hi Martin,
"Why not passing it to the save attachment API?" It's just not done, because we didn't have a need for it. But it wouldn't be hard to do. We could add those as request parameters to the query.
The code that computes the query is in saveAttachments() in FormRunnerPersistence.scala. There `holder` points to the instance node that contains the file, and that has the following attributes: filename="" mediatype="" size="". So this information could be passed on the query string. Does that feel like something you'd like to implement? If you get to implement and test it, we'll gladly look into your pull request.
Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet