[Bug] File type column cannot read the selected filename

@praveen @brian @tony
When I use a File type column, there are some certain cases that I don’t want the users to upload files other than PDF, DOC or restrict the upload of certain file types like PNG, JPG etc. To verify this shall be as easy as constructing a Valid_if expression like:

".PDF" = UPPER(RIGHT([FileColumnName],4))

However, whatever way you construct this kind of expression to ensure the file type, the expression evaluates to a null value (empty string) and therefore always eval to FALSE.

Status Not Planned
17 19 1,870
19 Comments
tony1
New Member

Hi Levent, this seems like a good use case that the platform should support. The reason that this doesn’t work right now is due to the way that AppSheet represents files. The platform only creates the file name after the record is synced. So the filename is not yet available during form validation. Do you mind if I switch this to a feature request?

LeventK
Silver 5
Silver 5

Hello @tony
Sure you can switch. But this is a very important case that we should be able to read the uploaded/selected filename so that we can restrict the type of files to be selected. For example I have a public app which users can upload files which I only need either a PDF or a DOC/DOCX file. As it’s a public facing app I don’t want some lamers to upload XXX pictures instead for example. So there should be a way to accomplish this.

Austin
Gold 1
Gold 1

A workaround for the mean while would be a “staging” table of sorts where it gets checked and then the user returns there is the file type is invalid or they continue on if it is valid.

Definitely agree with the feature becoming native though.
Got my vote!

Fabian_Weller
Gold 1
Gold 1

Hi @LeventK maybe you could use the Google API to detect explicit content:

https://cloud.google.com/vision/docs/detecting-safe-search

pravse
Staff

I think this is a common enough use case that we’d want to have something in the File column type definition that identifies what the allowed mime types (or equvalently, file extensions) are. It is just a more structured way of representing a valid_if constraint that occurs a lot. That way, the file picker itself could be limited to fetching files of the desired types.
@natalie fyi

Jonathan_S
New Member

Anything on this yet?

jonas_dont
New Member

I would also be happy about this feature.

Ed_Cottrell
Bronze 5
Bronze 5

We’re currently building a telecommunications (moreover) a remote workforce management app (to replace our current solution) that will require subcontractors to submit ‘completion artefacts’ from the field to claim completed work payments. The volume of data collected is tremendous in any given day. Having file type validation would cut-down immeasurably the amount of manual checking of artefacts before approving progress claims.

This has my vote! Thanks @LeventK and @praveen

Daniela_Carolin
Bronze 5
Bronze 5

Any updates in this request?

Grant_Stead
Silver 5
Silver 5

@praveen This one needs some love. I really need to constrain this column file to only accept pdfs… It looks like the current implementation doesn’t even validate what is displayed on screen?

Austin
Gold 1
Gold 1

Could you try changing around your security settings to see if maybe that works? It may be that the column is being set to some temp/hidden/protected url string before the form is saved. Maybe TEXT() too just for the heck of it.

bump*

Grant_Stead
Silver 5
Silver 5

Possibly, but I doubt it.

thethunderbird
Bronze 4
Bronze 4

Can confirm that wrapping with TEXT() does not solve the issue.

Status changed to: Open
Pratyusha
Community Manager
Community Manager
 
silentfred
Bronze 2
Bronze 2

Would also like to restrict file mime types on the file column