Class Index

Classes


Upload

Upload an asset into MediaBeacon
Defined in: upload.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Upload(file, dest, destId, unzip, version, verbose, fields, message, replaceMetadata, replaceName, triggerAssetBasedWorkflow, asyncImport)
For every asset defined in "data", this endpoint sets the xmp from the given xmp string
Class Detail
Upload(file, dest, destId, unzip, version, verbose, fields, message, replaceMetadata, replaceName, triggerAssetBasedWorkflow, asyncImport)
For every asset defined in "data", this endpoint sets the xmp from the given xmp string
Parameters:
file
the file needs to be added to the body of the POST in the form data with the name "file"
dest
the path to the destination folder "upload/here/"
destId
the directory id of the destination folder.
unzip Optional, Default: false
unzip the uploaded files
version Optional, Default: false
if a file already exists in the destination, new version it with the uploaded file
verbose Optional, Default: false
Setting this to true will collect a variety of default values for each asset.
fields Optional
An array of field id's to collect the values for each asset
message Optional
Comment for versioned file
replaceMetadata Optional, Default: false
Replace metadata for versioned file
replaceName Optional, Default: false
Replace name for versioned file
triggerAssetBasedWorkflow Optional, Default: true
set to false to avoid triggering other asset added workflows
asyncImport Optional, Default: false
set to true to import the uploaded file asynchronously
Deprecated:
[replace=false] use 'version' instead, now it creates a new version if the file already exists.
Returns:
[{assetInfo}, ... ]
/wf/restapi/v2/upload

Parameters:
file={{FILE DATA IN POST BODY}}
dest="upload/here/"
verbose=true

Response:
 [
 {
		 "id": 201629401,
		 "name": "heic0006a_orig.tif",
		 "path": "upload/here/heic0006a_orig.tif",
		 "height": 746,
		 "width": 1500,
		 "bytes": 1459026,
		 "lastModified": 1508187662000,
		 "mimeType": "image/tiff",
		 "previews": {
			 "thumbnail": "../servlet/jb.view?table=thumbnails&col=thumbnails&id=pe_323031363239343031",
			 "viewex": "../servlet/jb.view?table=viewex&col=viewex&id=pe_323031363239343031",
			 "downloadUrl": "../servlet/dload?id=pe_323031363239343031"
		 }
	 }
 ]
/wf/restapi/v2/upload

Parameters:
file={{ZIPPED FILE}}
dest="upload/here/"
unzip=true
verbose=true

Response:
 [
 {
		 "name": "hubble",
		 "path": "upload/here/",
		 "resolver": "directory://162",
		 "assets": [
			 {
				 "id": 201629404,
				 "name": "heic0006a_orig.tif",
				 "path": "upload/here/heic0006a_orig.tif",
				 "height": 746,
				 "width": 1500,
				 "bytes": 1459026,
				 "lastModified": 1262635000,
				 "mimeType": "image/tiff",
				 "previews": {
					 "thumbnail": "../servlet/jb.view?table=thumbnails&col=thumbnails&id=pe_323031363239343034",
					 "viewex": "../servlet/jb.view?table=viewex&col=viewex&id=pe_323031363239343034",
					 "downloadUrl": "../servlet/dload?id=pe_323031363239343034"
				 }
			 },
			 {
				 "id": 201629405,
				 "name": "heic0106a1_orig.tif",
				 "path": "upload/here/heic0106a1_orig.tif",
				 "height": 573,
				 "width": 564,
				 "bytes": 817080,
				 "lastModified": 1262635000,
				 "mimeType": "image/tiff",
				 "previews": {
					 "thumbnail": "../servlet/jb.view?table=thumbnails&col=thumbnails&id=pe_323031363239343035",
					 "viewex": "../servlet/jb.view?table=viewex&col=viewex&id=pe_323031363239343035",
					 "downloadUrl": "../servlet/dload?id=pe_323031363239343035"
				 }
			 }
		 ]
	 }
 ]
/wf/restapi/v2/upload

Parameters:
file={{FILE DATA IN POST BODY}}
destId=123
verbose=true

Response:
 [
    {
		 "id": 201629401,
		 "name": "heic0006a_orig.tif",
		 "path": "upload/here/heic0006a_orig.tif",
		 "directoryId": 123
		 "height": 746,
		 "width": 1500,
		 "bytes": 1459026,
		 "lastModified": 1508187662000,
		 "mimeType": "image/tiff",
		 "previews": {
			 "thumbnail": "../servlet/jb.view?table=thumbnails&col=thumbnails&id=pe_323031363239343031",
			 "viewex": "../servlet/jb.view?table=viewex&col=viewex&id=pe_323031363239343031",
			 "downloadUrl": "../servlet/dload?id=pe_323031363239343031"
		 }
	 }
 ]
/wf/restapi/v2/upload

Parameters:
file={{FILE DATA IN POST BODY}}
dest="upload/here/"
verbose=true
asyncImport=true

Response:
 [
	 {
		 "name": "heic0006a_orig.tif",
		 "path": "upload/here/heic0006a_orig.tif",
		 "actionId": "12AF58A0-6C54-4413-91D7-D1A521B9D6D2"
	 }
 ]

Documentation generated by JsDoc Toolkit 2.4.0 on Fri Dec 15 2023 01:44:02 GMT-0600 (CST)