Example 14: File
This example provides the basics on how to load files from a Windchill Extension into the system.
You can find the code for this example in our GitHub repository.
Introduction
This example will load a file from the Diagnostics window of a Windchill Extension and output some text to the Background Method Server.
Implementation
The loading is triggered by a Diagnostics screen of the extension, which can be found in the Extension Manager.
This will send an AJAX call to the backend and run the function.
Execution
The Diagnostics window will execute the function using apache commons to process the request into a stream.
Once the file is uploaded, a message will display in the window telling the user to check the Method Server logs.
The output will be displayed in the Background Method Server after the upload is completed.