HRESULT SetMIMEType(IltmsServer* server, LPCTSTR extension, LPCTSTR contenttype)
{
HRESULT hr;
CComPtr<IltmsMIMETypes> types;
// this routine will set a content type for an extension
// if extension == NULL, then the entire list is cleared
// if contenttype == NULL, then the extension will be removed
// *the extension should not include the starting period
// retrieve a copy of the MIME Types
hr = server->GetMIMETypes(&types);
if(FAILED(hr))
goto error;
if(extension != NULL)
{
if(contenttype != NULL)
hr = types->Add(CComBSTR(extension), CComBSTR(contenttype));
else
hr = types->Remove(CComBSTR(extension));
}
else
{
hr = types->Clear();
}
// copy the MIME Types to the server
hr = server->SetMIMETypes(types);
if(FAILED(hr))
goto error;
error:
return hr;
}
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.