Attachment Utilities
38 min
attachment utilities provides a suite of tools for file conversion and data extraction, facilitating seamless integration and automation of attachment handling processes the attachment utilities connector is a versatile tool for swimlane turbine users, providing a suite of actions to manipulate and transform file attachments and data formats it enables the conversion of attachments to base64 strings, plain text, and json, as well as the extraction of text and images from various file types this connector streamlines the process of downloading files from urls and facilitates the analysis of content by converting files into more accessible formats by integrating with attachment utilities, users can automate the extraction, transformation, and analysis of file data, enhancing the capabilities of their security automation workflows within swimlane turbine prerequisites capabilities the attachment utils connector has the following capabilities convert a base64 string to an attachment type convert an attachment to text convert an attachment to base64 download file from url extract text from image (ocr) extract images from an html file extract images from a url xlsx and csv to json action setup extract text from image (ocr) page segmentation mode values 0 orientation and script detection (osd) only 1 automatic page segmentation with osd 2 automatic page segmentation, but no osd, or ocr (not implemented) 3 fully automatic page segmentation, but no osd (default) 4 assume a single column of text of variable sizes 5 assume a single uniform block of vertically aligned text 6 assume a single uniform block of text 7 treat the image as a single text line 8 treat the image as a single word 9 treat the image as a single word in a circle 10 treat the image as a single character 11 sparse text find as much text as possible in no particular order 12 sparse text with osd 13 raw line treat the image as a single text line, bypassing hacks that are tesseract specific ocr engine mode values 0 legacy engine only 1 neural nets lstm engine only 2 legacy + lstm engines 3 default, based on what is available action limitation extract images from html this action can extract images from a html file only if full paths are available to image sources (i e , something like http //\<base url>/\<path to image>) actions attachment to base64 converts an attachment to a base64 encoded string, requiring the 'attachments' input for processing endpoint method get input argument name type required description attachments array required file to be uploaded file string optional parameter for attachment to base64 file name string optional name of the resource description string optional parameter for attachment to base64 output parameter type description filename string filename base64 string base64 string example \[ { "filename" "string", "base64" "string" } ] attachment to text converts specified attachments into plain text to enable content analysis and processing within the swimlane platform endpoint method get input argument name type required description attachments array required file to be uploaded file string optional parameter for attachment to text file name string optional name of the resource description string optional parameter for attachment to text output parameter type description filename string filename text string text example \[ { "filename" "string", "text" "string" } ] base64 to attachment converts a base64 encoded string into an attachment file within the attachment utilities service endpoint method get input argument name type required description filename string optional filename base64 string optional base64 encoded file output parameter type description file object attachments file string output field file file name string name of the resource example \[ { "file" { "file" "string", "file name" "example name" } } ] download file from url downloads a file from a provided url for processing within the swimlane platform, requiring the url as an input endpoint method get input argument name type required description url string required url endpoint for the request file name string optional name of the resource verify ssl boolean optional verify ssl certificate http proxy string optional a proxy to route requests through output parameter type description file object attachments file string output field file file name string name of the resource example \[ { "file" { "file" "string", "file name" "example name" } } ] extract images from html file extracts images from an html file for analysis and storage, requiring an 'attachments' input endpoint method get input argument name type required description attachments array required file to be uploaded file string optional parameter for extract images from html file file name string optional name of the resource description string optional parameter for extract images from html file verify ssl boolean optional verify ssl certificate http proxy string optional a proxy to route requests through output parameter type description file array extracted images file string output field file file name string name of the resource example \[ { "file" \[] } ] extract images from url retrieve all images from a specified url's html content, enabling efficient extraction for analysis endpoint method get input argument name type required description url string required url endpoint for the request verify ssl boolean optional verify ssl certificate http proxy string optional a proxy to route requests through output parameter type description file array extracted images file string output field file file name string name of the resource example \[ { "file" \[] } ] extract text from image (ocr) extracts text from an image file attachment for analysis or processing in attachment utilities endpoint method get input argument name type required description attachments array required file to be uploaded file string optional parameter for extract text from image (ocr) file name string optional name of the resource description string optional parameter for extract text from image (ocr) languages array optional languags of the text to be extracted default eng psm number optional control the automatic page segmentation mode used by tesseract oem number optional controls the type of algorithm used by tesseract timeout number optional duration in seconds for the ocr processing, after which, pytesseract will terminate and raise runtimeerror nice number optional modifies the processor priority for the tesseract run nice adjusts the niceness of unix like processes output parameter type description filename string name of the resource extracted text string output field extracted text example \[ { "filename" "string", "extracted text" "string" } ] xlsx and csv to json transforms xlsx and csv file attachments into json format for simplified data manipulation and integration endpoint method get input argument name type required description attachments array required file to be uploaded file string optional parameter for xlsx and csv to json file name string optional name of the resource description string optional parameter for xlsx and csv to json output parameter type description json array output field json example \[ { "json" \[] } ]