NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Matthew51 on January 10, 2023, 05:43:10 PM

Title: Remove file name from File Upload
Post by: Matthew51 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
Title: Re: Remove file name from File Upload
Post by: Bruce 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
Title: Re: Remove file name from File Upload
Post by: Matthew51 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