Skip to main content
10-Marble
March 11, 2016
Question

Possibilty of exclude files by extensions and/or by size when they are uploaded to a WT_Document in Windchill

  • March 11, 2016
  • 4 replies
  • 4017 views

Windchill should exclude some files to upload in a WT_Document.

The filter should be by extensión (.odt, .exe, .....) or by size (for example only upload files minus than 500 MB.

These filters should be configurated by preferences.

4 replies

18-Opal
March 11, 2016

Definitely doable.

A way to do something like this is with a listener.

You write and registers a listener to listen for the specific event.  Probably need to listen for both POST_STORE and POST_MODIFY event as you'd probably want to check this condition for both new WTDocs and exisiting WTDocs.

There might also be an UPLOAD event that would work as well.  I'd have to investigate to see if such an event exists and if it if fired during upload to WTDocs.

When the event occurs your custom code runs.  Your code checks the extension and files size.

If either are not valid throw an Exception.

The user would be notified immediately of the problem and could not check in the WTDoc until the upload was validated.

You do need to know some Java to do this but it is very doable.  I've done stuff like this in the past to check attributes where OOTB constraints could not get the job done.

18-Opal
March 11, 2016

Jose,

I recalled I had done something like this for a customer. The customer wanted to limit WTDoc attachments file types.

The events I keyed off were POST_STORE and POST_MODIFY.

13-Aquamarine
April 22, 2024

I find it pretty amazing that in the growing amount of security issues during the years when these kind of questions started, this has not been added.. Basing development on "amount of votes for an idea" doesn't cut it here. There's plenty of logical reasons to allow checks of some sort (extension, MIME type, etc.) for uploads without extensive coding done by every customer.

https://www.ptc.com/en/support/article/CS54468

https://www.ptc.com/en/support/article/CS356834

https://community.ptc.com/t5/Windchill-Ideas/Prevent-upload-of-possibly-dangerous-file-types-to-Windchill/idi-p/456860

https://www.ptc.com/en/support/article/CS401738

 

HelesicPetr
22-Sapphire II
22-Sapphire II
April 22, 2024

Hi @Zoltán 

Yes your right it is interesting. but the idea has been archived = no plan to implement.

There were low votes and no one cared about this idea to recreate it and support the voting. 

 

Trust me the risk is pretty low that some paid user with their password would upload a dangerous file to the system.

It is their responsibility to keep a system safe on daily manner. 

 

PetrH. 

 

 

13-Aquamarine
April 22, 2024

I agree that users should be trusted to comply with certain standards, behaviours, etc. and that liberal access to system for example is good, but I see companies wanting to narrow down risks, so this feature is probably interesting for far more than can be collected from a vote on an idea.

Well, we'll see what the future brings. 🙂

14-Alexandrite
May 18, 2024

Windchill does not filter any extension for wtdocument because they could come from any authoring applications

 

There is an example of scan files in the help center, see https://www.ptc.com/en/support/article/CS361825

 

You can create custom preferences and check their runtime or user values from within the code.

 

I believe you will also deal with Apache config for large file size