Skip to main content
16-Pearl
May 10, 2019
Solved

File Upload validation

  • May 10, 2019
  • 2 replies
  • 6130 views

Hi,

I am using the File upload widget to upload the files into system repository.

 

How to validate the chosen file name is already available into repository before click on upload button?.

Could you please give the steps how to validate?.

Currently what is happening is its overriding existing file if file name is same.

 

Thank you in advance....

 

File Uplaod.png  

Regards,

Latha

Best answer by serler

Unfortunately your picture is not visible in the last post.

The idea is, that the file upload button is disabled and not visible, but instead you can use the upload action.

 

You can trigger the upload action by a button click or any other thingworx event on the UI.

2 replies

5-Regular Member
May 13, 2019

You can return a list of file names from the Repository you're using through GetFileListing service in FileRepository Template.  You can compare the file name with new file through some script or you can just post the list and let the user compare by themselves.

5-Regular Member
May 13, 2019

A while ago, I had a similar problem of doing some validation. The post from zyuan1 is good.
As I wanted to automate it, I changed the standard widget, by deactivating the "upload" button and enable the widget to trigger upload by a service.

 2019-05-13_11-16-00.png              2019-05-13_11-16-14.png

If you want I can provide you the widget, just send me a short message here.

DISCLAIMER: This mashup is not supported by PTC and not maintained during new releases. It was developed in 8.1 and is still working in 8.4, but that might change in future versions.

vi116-PearlAuthor
16-Pearl
May 13, 2019

Thank you for information.

 

Could you please provide the widget?.

 

Regards,

Latha

5-Regular Member
May 13, 2019

I have seen, that I could also upload it here.

Please feel free to use it or modify it as needed.