cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

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

jdelgado
10-Marble

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

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.

9 REPLIES 9

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.

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.

Zoltán
13-Aquamarine
(To:jdelgado)

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 I
(To:Zoltán)

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. 

 

 

Zoltán
13-Aquamarine
(To:HelesicPetr)

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. 🙂

@Zoltán , does your company have a need for preventing uploads of file types and/or the file size?

 

I would agree that waiting for an idea to be voted up and then actually built into OOTB Windchill is not really a plan to get anything done.

I gave up on enhancement requests 20 years ago as it’s obvious if we needed something that was not OOTB I needed to write the code to do it. That’s really the only way to get stuff like this done. It just is. 🤷‍♂️

That said, writing something to prevent upload of files by extension, size, or whatever is very doable.

 

David

HelesicPetr
22-Sapphire I
(To:d_graham)

I agree with @d_graham 

It is faster to write own custom solution then just waiting for PTC implementation...

PetrH

Zoltán
13-Aquamarine
(To:HelesicPetr)

Thanks everybody for your input on this.

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

Announcements

Top Tags