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.
  • 0
    Certified Lead Developer
    in reply to aloks0189

    Hi,

    I tried uploading empty document to the KC, it is accepting that document not giving any error.

    Just showing size is < 1KB.

     

  • 0
    Certified Lead Developer
    in reply to shwetad7106

    Hi Shweta,

    You might be just navigating interface to upload empty file.. it shows that it is less than <0 kb and show attach file where as the minute you try to submit it will pop up with error message and doesn't allow to upload it. You might get error something like below As already shared by most of us.

    Appian has kept the constrains to upload empty or zero size file. For me it make sense to have it in place.
    I would be more interested to understand the business case why do you need to upload the zero kb file. if the requirement is to generate the document, you could simply achieve by having template and generate the file on runtime.

Reply
  • 0
    Certified Lead Developer
    in reply to shwetad7106

    Hi Shweta,

    You might be just navigating interface to upload empty file.. it shows that it is less than <0 kb and show attach file where as the minute you try to submit it will pop up with error message and doesn't allow to upload it. You might get error something like below As already shared by most of us.

    Appian has kept the constrains to upload empty or zero size file. For me it make sense to have it in place.
    I would be more interested to understand the business case why do you need to upload the zero kb file. if the requirement is to generate the document, you could simply achieve by having template and generate the file on runtime.

Children
No Data