Upload files via REST API #748

GitHub: https://github.com/ironmansoftware/universal-dashboard/issues/748
BountySource: https://www.bountysource.com/issues/72799550-upload-files-via-rest-api
Amount: 65.00 USD

'tis ready!


@BoSen29 your Mrs is going to want an awesome date night with all this bounty money :smile:

Congratualations smashing another fix!

1 Like

Well, i was planning on adding it to my CSGO fancy Knfie fund.
A decent date night will probably be a better investment tho :sweat_smile:


Is there a way to provide additional parameters into the a File Upload Rest API Endpoint?
From the docs it seems it only supports a $File param? I would like to post additional details like meta data, but more importantly, the filename and extension.

Hi @mieel,

Sadly, the only metadata avaliable is whatever you content-type you specify.
IE use: contenttype “file$filename” to have a minimal metadata input.

The RESTapi backend handles file* and img* as file uploads (where * is a wildcard), and only accepts the actual file in the body of the request. Hence, you can specify the filename in the contenttype.

How do you retrieve the value of the ‘contenttype’ within the New-UDEndpoint?

*nvm, found it in the docs: https://docs.universaldashboard.io/rest-apis#returning-xml

1 Like