Skip to content

Instantly share code, notes, and snippets.

@Bugerman58
Bugerman58 / gist:8344a80082454c0cdc38ab0112efae81
Last active April 23, 2024 09:20
Store DICOM file to DCM4CHEE using PHP script
<?php
declare(strict_types = 1);
define("BOUNDARY", bin2hex(random_bytes(10)));
$filePath = 'test.dcm';
$baseUrl = 'http://127.0.0.1:8080';
$AET = 'TESTAETITLE';
/**
@Bugerman58
Bugerman58 / gist:975393fbd2739b9ea0c9bef18642c05c
Last active April 23, 2024 09:23
Store DICOM file to DCM4CHEE using cURL via bash script
#!/bin/bash
# destination url and AE title
baseUrl="http://127.0.0.1:8080"
AET="TESTAETITLE"
boundary=$($RANDOM | md5sum | head -c 20)
header="--$boundary\r\n"
header="${header}Content-Disposition: form-data;name=\"file\";filename=\"$1\"\r\n"