Here’s the complete solution for CAD viewer integration with external storage:
1. CORS Configuration on External Storage:
For S3-compatible storage, add this CORS policy to your bucket:
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>https://your-windchill-server.com</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>HEAD</AllowedMethod>
<AllowedHeader>Range</AllowedHeader>
<AllowedHeader>Content-Type</AllowedHeader>
<AllowedHeader>Authorization</AllowedHeader>
<ExposeHeader>Content-Length</ExposeHeader>
<ExposeHeader>Accept-Ranges</ExposeHeader>
<ExposeHeader>Content-Range</ExposeHeader>
<MaxAgeSeconds>3600</MaxAgeSeconds>
</CORSRule>
</CORSConfiguration>
Key points:
- Use exact Windchill server URL, not wildcard (security best practice)
- GET and HEAD methods are required for viewer operations
- Range header enables byte-range requests for streaming
- Expose Content-Length and Accept-Ranges so viewer can validate streaming support
- MaxAgeSeconds caches CORS preflight responses to improve performance
2. File Streaming Support:
Ensure your external storage supports HTTP range requests. Test with curl:
curl -I -H "Range: bytes=0-1023" https://external-storage.com/file.prt
Response should include:
HTTP/1.1 206 Partial Content
Content-Range: bytes 0-1023/total_size
Accept-Ranges: bytes
If you get 200 instead of 206, the server doesn’t support range requests and the viewer won’t work efficiently with large files.
3. Viewer Embedding Configuration:
In Windchill viewer configuration (codebase/com/ptc/windchill/uwgm/viewer/viewer.properties):
viewer.external.content.enabled=true
viewer.streaming.mode=true
viewer.external.content.protocol=https
viewer.cors.validation=strict
This tells the viewer to:
- Enable external content source handling
- Use streaming mode for large files
- Require HTTPS for external URLs (security)
- Validate CORS headers before attempting to load
4. Content Security Policy:
If your Windchill server has CSP headers configured, update them to allow the external storage domain:
Content-Security-Policy:
default-src 'self';
img-src 'self' https://external-storage.com;
connect-src 'self' https://external-storage.com;
5. Authentication Handling:
If your external storage requires authentication, configure the viewer to pass credentials:
- For pre-signed URLs: Include authentication token in URL parameters
- For header-based auth: Configure viewer to include Authorization header in requests
- Test that the authentication doesn’t conflict with CORS (credentials mode must match CORS policy)
Testing Checklist:
- Verify CORS policy is active on external storage (check with browser dev tools)
- Confirm range request support with curl test
- Test viewer with small CAD file first (under 10MB)
- Verify HTTPS is used for both Windchill and external storage
- Check browser console for any remaining CORS or CSP errors
- Test with large file (over 100MB) to validate streaming works
Common Issues:
- Mixed content: Windchill HTTPS but storage HTTP (browser blocks)
- Missing Accept-Ranges header: Viewer can’t detect streaming support
- CORS policy not applied: Check bucket-level vs object-level policies
- Authentication conflicts: Pre-signed URLs may need CORS policy adjustment
By properly configuring all three focus areas (CORS headers on external storage, file streaming with range request support, and viewer embedding configuration), the CAD viewer will successfully display previews from external storage locations. The key is ensuring both the storage server and Windchill viewer are configured to work together with proper security and streaming capabilities.
This draft is based on general Windchill knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.