Could not upload “zero size”. Reason: This file is empty

I am getting the below error message when I tried to upload zero size document.Though I am validating size of the file, getting the below error message:

An Error Has Occurred

Could not upload “zero size”. Reason: This file is empty

How can I remove this error message?

sample code :


load(
local!FileSize:0,
local!fileName,
a!formLayout(
label: "Upload Document Sample",
firstColumnContents: {
a!fileUploadField(
label: "File Upload",
labelPosition: "ABOVE",
instructions: "",
target:"Temporary Documents",
value: fileName,
saveInto: {
fileName,
a!save(local!FileSize,a!fileUploadField(value:fileName).uploadedDocumentSize)


},
validations: {

if(FileSize<=0,"Error, file size",null )
}
),

},

secondColumnContents: {
/* Add components here for a two-column form */
},
buttons: a!buttonLayout(
primaryB...

OriginalPostID-224673

OriginalPostID-224673

  Discussion posts and replies are publicly visible

Parents
  • i have to allow uploading an empty file. is it possible?
  • 0
    Certified Lead Developer
    in reply to ramakg
    Hi why do you want to upload an empty file into Appian KC? I believe, it doesn't add any difference whether you upload an empty document or don't upload any document. Hence Appian doesn't allow uploading an empty document

    Your file must contain at least one binary stream content / character, in order to upload it to Appian KC.

    Also, as we know, Appian need to generate a document id and need to insert few rows into its primary DB whenever a new document gets uploaded into KC. Hence when your document is empty means there are no reason to perform these set of operations.

    However, if your business requirement still require you to upload an empty document then you need to discuss with Appian support, hope they will be able to help you on this.
Reply
  • 0
    Certified Lead Developer
    in reply to ramakg
    Hi why do you want to upload an empty file into Appian KC? I believe, it doesn't add any difference whether you upload an empty document or don't upload any document. Hence Appian doesn't allow uploading an empty document

    Your file must contain at least one binary stream content / character, in order to upload it to Appian KC.

    Also, as we know, Appian need to generate a document id and need to insert few rows into its primary DB whenever a new document gets uploaded into KC. Hence when your document is empty means there are no reason to perform these set of operations.

    However, if your business requirement still require you to upload an empty document then you need to discuss with Appian support, hope they will be able to help you on this.
Children