Hi all
When uploading a File (Document) type, there is no way of knowing the
File Size, File Name, or File Extension in the object.
If you are doing any document storage or document handling application or special rules on the document, this information becomes important
Support have quoted me to develop a plug-in that will let you access these attributes.
The function will be just like any other function - you can use them in rules as usual.
If you are interested in Pitching in to get his function please PM me
Thank you
Document Attributes - Pitch in Request
This is now possible in build 1204.
Assuming the uploaded doc is stored in Doc.DocStorage, following are 3 rules to make it work.
1) Doc.DocName=FILE_NAME(Doc.DocStorage)
2) Doc.DocExt=FILE_EXTENSION(Doc.DocStorage)
3) Doc.DocFileSize=FILE_SIZE(Doc.DocStorage)
Assuming the uploaded doc is stored in Doc.DocStorage, following are 3 rules to make it work.
1) Doc.DocName=FILE_NAME(Doc.DocStorage)
2) Doc.DocExt=FILE_EXTENSION(Doc.DocStorage)
3) Doc.DocFileSize=FILE_SIZE(Doc.DocStorage)
Tom - V8.8 build 3137 - MySql / PostGres
FILE_EXTENSION
Tom (or others),
I have tried getting the FILE_EXTENSION to work but can´t seem to get it to do what I want. I basically want to control/restrict the kinds of files users can upload. This is what I´ve tried but without success:
If Photo IS NEW AND FILE_EXTENSION(Photo.Photo)<>'png' Then
REPORT ERROR 'Photo format error. Please upload png files only'
Can you/someone please help me get this to work? Thanks
I have tried getting the FILE_EXTENSION to work but can´t seem to get it to do what I want. I basically want to control/restrict the kinds of files users can upload. This is what I´ve tried but without success:
If Photo IS NEW AND FILE_EXTENSION(Photo.Photo)<>'png' Then
REPORT ERROR 'Photo format error. Please upload png files only'
Can you/someone please help me get this to work? Thanks
Henrik (V8 Developer Ed. - Windows)
Hum
I am maybe on to one of the causes of my error.
First of all, in my previous example I wrote png file extension, it´s really jpg I want users to upload but had some issues trying it so I tested with png. I also used the SCALE_IMAGE function with uploaded images and I think this function when scaling the image also converts it to jpg file format (support can possible confirm?) and if so, this explains the errors i´ve had (at least with png files). I will onctinue testing but still, please share feedback if you know a bit more about the FILE_EXTENSION function. Thanks
First of all, in my previous example I wrote png file extension, it´s really jpg I want users to upload but had some issues trying it so I tested with png. I also used the SCALE_IMAGE function with uploaded images and I think this function when scaling the image also converts it to jpg file format (support can possible confirm?) and if so, this explains the errors i´ve had (at least with png files). I will onctinue testing but still, please share feedback if you know a bit more about the FILE_EXTENSION function. Thanks
Henrik (V8 Developer Ed. - Windows)
THX
Thanks Kklosson, then it works to use it like I have at least. I will continue testing and again I think maybe the problem was me using the SCALE_IMAGE together with the FILE_EXTENSION.
Henrik (V8 Developer Ed. - Windows)