Downloading Item Attachments

Nested Documents of an Item

You should be able to determine most of the properties of an item by reading the outputted JSON, files however you will only have a link to. There are many ways that you can save a document into ScienceBase but, luckily, there are a few quick ways to get all of the documents out.

Downloadable Links

Many items will have external links that are added to ScienceBase as WebLinks. These WebLinks will have the type equal to "download" and the uri will be the link to the download.

Documents Uploaded into ScienceBase

Many times a user will upload data directly into ScienceBase. To download all of the data associated with an item as a zip file (or as the individual file if there is only one) you can go to<itemId>.

Downloading individual items is a little trickier as you must first find the "pathOnDisk". If the file was uploaded directly to ScienceBase and not associated with any types it can be found under the "files" key. Each entry in this will have a pathOnDisk key that contains the necessary path. If the file was associated with a facet (eg, Shapefiles, Rasters, Map Packages) You have to navigate to the facets, find the one that you want (eg. className = gov.sciencebase.catalog.item.facet.ShapeFileFacet for shapefiles) and look under the files key here to find the appropriate "pathOnDisk".

Once you have the pathOnDisk you use the same URL as you would to get the zip, but with the option f=pathOnDisk:<itemId>?f=<pathOnDisk>