1

I have the following source code that works great if the file uploaded is not empty:

<h:outputText value="#{messages.updreps_title_upload}" styleClass="updRepTitle" style="margin: 20px 0 20px 0;" />
<t:div id="updRepDivId" style="display: #{updateReportController.selectedProj==''?'block':'block'}">
    <t:div styleClass="fileUploadUpdateReport">
        <t:inputFileUpload required="false" immediate="true" id="fileupload" accept=".xlsx, .xls" value="#{updateReportController.uploadedFile}" storage="file"  onchange="updRepBProjFile(this);"/>
    </t:div>

    <t:div styleClass="formButtons" style="margin: 0 0 20px 0;">
        <h:commandButton id="buttonUpdateReportUploadId" value="#{messages.global_upload}" action="#{updateReportController.doUploadUpdateReport}"/>
    </t:div>
</t:div>

However if the file is an empty file the name of that file is lost and not past on to the updateReportController.doUploadUpdateReport

The onchange="updRepBProjFile(this);" part does only rename the file but as I said before it works with non empty file perfectly.

Why is it not working on empty files?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Thevagabond
  • 323
  • 2
  • 9
  • 34

0 Answers0