I want upload file DICOM and index all dcm files with orthanc Library. I write this code:
php:
if ($_SERVER['REQUEST_METHOD'] == 'POST'){
$url="http://localhost:8042/instances";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt($ch, CURLOPT_POST,1 );
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:
text/plain'));
foreach ($_FILES['files']['tmp_name'] as $i => $name) {
curl_setopt($ch,
CURLOPT_POSTFIELDS,file_get_contents($name));
$result=curl_exec($ch);
print_r($result);
}
}
html:
<form method="post" enctype="multipart/form-data" action="#">
<input type="file" name="files[]" id="files" multiple="" directory=""
webkitdirectory="" mozdirectory="">
<input class="button" type="submit" value="Upload" />
</form>
this code takes long time so mush.. what is problem ?? I want method to upload directory of dcm files and index its togother with API orthanc and using php, js..
thank you..