NetTalk Central

Author Topic: How to get File Name of file to be uploaded before it is uploaded  (Read 424 times)

Johan de Klerk

  • Full Member
  • ***
  • Posts: 214
  • Johan de Klerk
    • View Profile
    • Designer Software
Hi Bruce,

I need to get the file name that the user selected to be uploaded as soon as it was Selected via the "Add File" button.
If the File Name is wrong or it has already been uploaded I want to run some clarion code and Clear the File Name/Selection and popup an Alert Message and the Start button should not show.
Or check the file name, run my clarion code, popup alert message and press the "Clear" button.

I need to verify the file name before the user uploads a 50MB file and then only in the Save File Embed I reject it if the file name is wrong or it has already been uploaded.
Each user on the system have a specific format and file name to check.

Can you please explain how I can achieve the above.

In the FireFox Developer Tools I see the File Name and Size in this section after it was selected:
<table id="Tngv24" class="nt-upload-table ui-corner-all" style="">
<tr id="Xmh993e">
<td>XTest_FileForUpload.json</td>
<td id="ZXmh993e">41 KB</td>
<td id="WXmh993e">
<span class="">Waiting</span>
</td>

Clarion 10, NetTalk 11.57.

Regards

Johan de Klerk
Clarion 10, NT 11.57

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: How to get File Name of file to be uploaded before it is uploaded
« Reply #1 on: January 21, 2024, 10:41:39 PM »
It's hard for me to give exact instructions because you are an old version of NetTalk.

But in general,
a) observe the log to see what appears (if anything) when the user selects a file.
b) read the JavaScript for the widget to see what methods (if any) might exist there to do the thing you want to do.

Cheers
Bruce