function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sarah J DSarah J D 

core.filemanager.FileBlobValue@238e461 error while uploading Excel

Hi,  

The requirement is When a user search a string, it should go through the content in excel cell by cell.  Finally, if the content matches, should return the cell Number(excel cell number eg. A1,B2..etc.).  Previously I tried for CSV, It worked fine. Excel contains image also.

When I'm trying to parse the input Excel file(xlsx extension), I'm getting this 'core.filemanager.FileBlobValue@238e461' error in backend?

VF Page:

<apex:page sidebar="true" controller="Excel_CLS">
    <apex:message />
    <apex:form >
        <apex:sectionHeader title="Upload data from CSV file"/>
        <apex:pagemessages />
        <apex:pageBlock >
            <center>
                <apex:inputFile id="ids" value="{!contentFile}" filename="{!nameFile}" /> <apex:commandButton action="{!ReadFile}" value="Upload File" id="theButton" style="width:70px;"/>
                <br/> <br/> <font color="red">  </font>
            </center>  
        </apex:pageBlock>       
    </apex:form>   
</apex:page>

Controller:

public class Excel_CLS 
{
    public string nameFile{get;set;}
    public Blob contentFile{get;set;}
    
    public Pagereference ReadFile()
    {
        String nameFile2 = EncodingUtil.urlDecode(st, 'UTF-8');
        Blob b = EncodingUtil.base64Decode(st);
        System.debug('*****'+nameFile);
        System.debug('*****'+contentFile);
        System.debug('*****'+b);
        System.debug('*****'+nameFile2);
        System.debug('*****'+b.toString());
        return null;
    }  
}

Appreciate your help!

Regards
Sarah