You need to sign in to do that
Don't have an account?
dai developer
Binary .dat file
Hello,
I have to import a file and read it (and validate the data) but cannot.
It has ".dat" extension and can edit it with notepad without a problem but with <inputfile> the body (utf8 encoded)
of the file is an unreadable sequence of chars (bytes?).
If i edit the file.dat with an editor and save it as .csv, my code works perfect(even break lines stay) but, curious enough, if i simply change
the file.dat extension to csv, i obtain the same unreadable string.
The code:
<apex:page controller="c_CargaFicheroPedidoController">
<apex:form >
<apex:pagemessages />
<apex:pageBlock >
<apex:pageBlockSection columns="4">
<apex:inputFile value="{!csvFileBody}" filename="{!csvAsString}" contentType="text/plain"/>
the controller
string dddfff = EncodingUtil.base64Encode(csvFileBody);
Thanks everybody
I have to import a file and read it (and validate the data) but cannot.
It has ".dat" extension and can edit it with notepad without a problem but with <inputfile> the body (utf8 encoded)
of the file is an unreadable sequence of chars (bytes?).
If i edit the file.dat with an editor and save it as .csv, my code works perfect(even break lines stay) but, curious enough, if i simply change
the file.dat extension to csv, i obtain the same unreadable string.
The code:
<apex:page controller="c_CargaFicheroPedidoController">
<apex:form >
<apex:pagemessages />
<apex:pageBlock >
<apex:pageBlockSection columns="4">
<apex:inputFile value="{!csvFileBody}" filename="{!csvAsString}" contentType="text/plain"/>
the controller
string dddfff = EncodingUtil.base64Encode(csvFileBody);
Thanks everybody
http://salesforce.stackexchange.com/questions/11805/blob-is-not-a-valid-utf-8-string-error