Forum Index

No notifications
Notifications

Favorites

No favorites found
General Training Discussion General chat and comment on KnowledgeKube training
KnowledgeKube Training > General Training Discussion > Getting "UploadedFileName" in a Document Uploader View modes: 
User avatar
KnowledgeKube Staff
KnowledgeKube Staff
matt.pitman - 04/08/2016 10:32:05
   
RE:Getting "UploadedFileName" in a Document Uploader
Hi Manny, Because of the way the Document Uploader question works, I'm afraid it's not as simple as adding the question to the parser and referencing it in an expression. As you probably know, there are a number of functions for interacting with files after they've been uploaded, the most fundamental of which being ListUploadedDocuments. This function produces a CSV list of files you've uploaded to session memory using a particular document uploader, including their filenames. If you have limited your uploader to accept a maximum of one file to session memory, the resulting CSV will look something like this:
266249c7-e951-4ef3-8d3f-0ee752d20655,company_logo.jpg,,company_logo.jpg,.jpg,25424
If this list is then assigned to a variable named (for example) CSVUploadDetails, you can fetch the file name using an expression like the one below:
MyFileName:= CSVGetListItemByIndex(1,CSVUploadDetails,"","|",",");
In this expression, we've treated each item in the CSV as an individual row (by specifying a comma as the Row Separator instead of the usual List Separator). This lets us fetch the second 'row' by referring to the item with index 1 (since index 0 refers to the first item). The result of this expression is company_logo.jpg being assigned to the MyFileName variable. If your uploader is intended to commit more than one file at a time, you could expand this expression to isolate a single entry from the CSV before extracting the file name as described above. If this is the case, let me know if you need some guidance on doing this. I've been chatting to the development team today about this functionality, and there will be some new functions added in the near future to make this process a lot more straightforward. In the meantime, if you need to learn more about functions for working with CSV, you can find a full guide here. Kind regards.

User avatar
Advanced member
Advanced member
   
Getting "UploadedFileName" in a Document Uploader
Hi, I was wondering on how to get the File name of the selected file browse in the file explorer of a Document Uploader Question. I am trying to get the Base 64 string of the file uploaded in the session but I can not get the value of the text inside the Document Uploader textfield. I already tried parsing the question to the expression and gave me an error. Another thing, does the button for uploading in the Document Uploader just add the file in the session? Or can it be used also to trigger other actions? Thanks!

RSS Feed