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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

File Upload validation

vi1
15-Moonstone
15-Moonstone

File Upload validation

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

1 ACCEPTED SOLUTION

Accepted Solutions
serler
7-Bedrock
(To:vi1)

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.

View solution in original post

8 REPLIES 8
zyuan1
18-Opal
(To:vi1)

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.

serler
7-Bedrock
(To:vi1)

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.

vi1
15-Moonstone
15-Moonstone
(To:serler)

Thank you for information.

 

Could you please provide the widget?.

 

Regards,

Latha

serler
7-Bedrock
(To:vi1)

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

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

vi1
15-Moonstone
15-Moonstone
(To:serler)

 

 

Thanks for providing the custom widget. I have downloaded.

vi1
15-Moonstone
15-Moonstone
(To:vi1)

Hi,

 

I have added new File Upload widget.By default, upload button is disabled.

How to enable the upload button?. What data type accepts the Upload binding property?.

 

 

 

 

Thanks&Regards,

Latha

serler
7-Bedrock
(To:vi1)

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.

vi1
15-Moonstone
15-Moonstone
(To:serler)

Hi,

 

Thank you for quick response.

I am able to bind upload service using click event.

 

Regards,

Latha

Top Tags