Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.StringException: Starting position out of bounds: 201590400 #26

Open
Akashkumar12 opened this issue Feb 28, 2019 · 7 comments
Open

Comments

@Akashkumar12
Copy link

During testing through the developer console. I got below error.
please help

System.StringException: Starting position out of bounds: 201590400
--

@AyuSharma-dev
Copy link

Hello @Akashkumar12 did you resolve it. I am also getting the same issue. Let me know if there's any solution for this. Thank you.

@runewage
Copy link

Hi
I am getting a similar error:

Line: 402, Column: 1
System.StringException: Starting position out of bounds: 1819193000

The Exception is thrown from the file Zippex.cls at line 402.
Based on the values of the variables it looks like the theStart and theEnd is way to high as the ZipFileString is only 1822 characters.

400: Integer theStart = offset+46;
401: Integer theEnd = theStart + HexUtil.hexToIntLE(fileNameLength);
402: fileName = zipFileString.substring(theStart*2, theEnd*2);// (f bytes)       Offset 46

The file I am trying to read is an excel file.
Here is values of the variables used:

theStart = 909596500
theEnd = 909596500
fileNameLength = 
zipFileString.length() = 1822

Here is the code I am running using Anonymous Apex in Developer Console.

List<Attachment> attList = [SELECT Id, Name, Body FROM Attachment WHERE ParentId='<Case ID>'];
if(!attList.isEmpty()){
	Zippex sampleZip = new Zippex(attList[0].Body);
}

@sravani-gadaputi
Copy link

while reading Pdf file am getting System.StringException: Starting position out of bounds: 646326178.Can you please help me on this.

Thank you.

@parsam97
Copy link

I am getting the same error:

System.StringException: Starting position out of bounds: 1194067618

@rajeev-ui
Copy link

rajeev-ui commented May 5, 2021

I am getting the same error:

System.StringException: Starting position out of bounds: 1141229184

Could anybody help in this issue ....

@geethaKrishnaja
Copy link

I am facing the same issue.. Please let me know if anyone has resolved this issue.

Thank you in advance

@dtissen
Copy link

dtissen commented Jan 31, 2022

I got this error everytime I tried to extract an corrupted ZIP File. Pay Attention which is the body of the BinaryAttachment. It should be a blob. During Testing convert your ZIP File into an HEX Value oder Base64String!

HEX
binaryAttachment.body = EncodingUtil.convertFromHex('YOUR HEX VALUE GOES IN HERE');

BASE64
binaryAttachment.body = EncodingUtil.base64DECODE('YOUR BASE64 ENCODED VALUE GOES IN HERE');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants