NetTalk Central

Author Topic: Remove file name from File Upload  (Read 1090 times)

Matthew51

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • Email
Remove file name from File Upload
« on: January 10, 2023, 05:43:10 PM »
I have a file upload set to use the camera on a phone. The file name given to these pictures are meaningless, and in the case of my phone overly large (see attachment). So large that the browser is destroying the format of the form trying to display it.

I would like to ether remove/hide the file name, or change it to 'Picture 1', 'Picture 2' etc. I'll then add a browse to show then the pictures that have been uploaded. I can't even figure out where in the code this table is created, or how to add my own css to it.

Thank you
Matthew
Contractor with 10+ years of NetTalk experience looking for work.
www.linkedin.com/in/matthew-leavitt
BisWare.ca
Check out my free EasyTime Template

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11155
    • View Profile
Re: Remove file name from File Upload
« Reply #1 on: January 10, 2023, 07:37:36 PM »
>> I can't even figure out where in the code this table is created, or how to add my own css to it.

The table is created inside jquery.nt-upload.js

It is an actual HTML Table, with the css class
nt-upload-table.

so you can easily add your own custom CSS using this class as a selector, and then hide things or whatever.

The filename inside the table is populated around line 341 in the javascript, from file.name

Cheers
Bruce

Matthew51

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • Email
Re: Remove file name from File Upload
« Reply #2 on: January 11, 2023, 08:23:44 PM »
So I starting thinking CSS might have the option to affect the first tag of a given type. Turns out it does, I added ' bw-hide-file' to Entry Div Class and the following to Custom.css:
Code: [Select]
.bw-hide-file .nt-upload-table td:first-of-type {
display:none;
}

It works perfectly so far, though I need to test a few more devices to be sure.

Matthew
Contractor with 10+ years of NetTalk experience looking for work.
www.linkedin.com/in/matthew-leavitt
BisWare.ca
Check out my free EasyTime Template