Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
20 replies
Subscribers
7 subscribers
Views
10523 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
How to retrieve the size of a file being uploaded using a!fileUploadField() sail
abhinavg
over 9 years ago
How to retrieve the size of a file being uploaded using a!fileUploadField() sail component on sail form and restricts the user to upload a file larger than a certain limit.
Is it correct that document(ri!file, "size") will work only when form is being submitted as document being uploaded is being saved on Appian DMS and not before if sail form is not being submitted
Attached a sail form snippet, need to capture the size being circle on form
Thanks !
OriginalPostID-141769
OriginalPostID-141769
Discussion posts and replies are publicly visible
0
Eduardo Fuentes
Appian Employee
over 9 years ago
That's correct. Before submitting the form you can't do anything with the document, it's a disabled object in Appian whose local ID is still considered invalid; once you submit the form the file is placed in the right directory with a new local id.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
abhinavg
over 9 years ago
Eduardo... then how can i do file size level validation on sail form
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 9 years ago
You can't until the form is submitted, you then check within the process using document(pv!file, "size") and if it exceeds the size delete the document and loop back showing an error message to the user
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
abhinavg
over 9 years ago
That was done already but business wants to restrict the user to hit upload button, if file size exceeds a defined limit....
BTW, is there any way to retrieve the value being circled in the post attachment, if not can it be added as a future enhancement
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 9 years ago
You can't operate with the document within the form itself at all. This is not possible without submitting the form.
However, you can control this globally in custom.properties for all forms
## The maximum allowed size in bytes for a document
resources.appian.ac.collaboration.MAX_UPLOAD_FILE_SIZE=1024000000
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
abhinavg
over 9 years ago
## The maximum allowed size in bytes for a document
resources.appian.ac.collaboration.MAX_UPLOAD_FILE_SIZE=1024000000
this custom property will fire at the form level before submission ?
if Yes, then it will impact the other file uploading functionality in other applications
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 9 years ago
Yes, this will generate an error message right after the user tries to upload the document without the need for submitting the form (see attached C:\\Users\\eduardo.fuentes\\Desktop\\max_file_size_exceeded.swf video where I set the maximum to 5MB).
This is a global setting that applies to other forms. That's the only available option that doesn't require you to submit the form.
max_file_size_exceeded.swf
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
abhinavg
over 9 years ago
Thanks Eduardo .. but concern is that this global property will effect other application running currently and going to be live in future.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 9 years ago
Those are the two options available: the setting for an in-form & before-submission validation of the size or checking within the process for an after-submission validation.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
abhinavg
over 9 years ago
Thanks ..will update the Business on same !
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>