Skip to main content
Jamf Nation, hosted by Jamf, is a knowledgeable community of Apple-focused admins and Jamf users. Join us in person at the ninth annual Jamf Nation User Conference (JNUC) this November for three days of learning, laughter and IT love.

fileupload api enhancement

Currently as of version 9.101, the fileupload api does this:

You can POST different types of files by entering parameters for {resource}, {idType}, and {id}, for example /JSSResource/fileuploads/computers/id/2. Attachments can be uploaded by specifying computers, mobiledevices, enrollmentprofiles, printers, or peripherals as the resource. Icons can be uploaded by specifying policies, ebooks, or mobiledeviceapplicationsicon as the resource. A mobile device application can be uploaded by using mobiledeviceapplicationsipa. A disk encryption can be uploaded by specifying diskencryptionconfigurations as the resource. idTypes supported are id and name, although peripheral names are not supported. A sample command is curl -k -u user:password https://my.jss:8443/JSSResource/fileuploads/computers/id/2 -F name=@/Users/admin/Documents/Sample.doc -X POST

It's good if you can work out what the id number is, or if you know the name of the id type. But there's a few enhancements I'd like to suggest.

1) The ability to list all file attachments and which ID they're attached to. This is already present in such api items like policies where you can see what name is attached to what ID.
2) The ability to delete file attachments from a specified resource. We can't, for example, delete icon files once they're uploaded. It would be very nice to have in order to help keep db bloat down.
3) The ability to download file attachments from a specified resource. That'd help add extra functionality to my jss config in a box project because again, I'd be able to migrate specific icon files to self service policies from one JSS to another. Currently I have to maintain a separate pool of icons and upload them manually and one by one.