Click here to Skip to main content
14,579,188 members
Rate this:
Please Sign up or sign in to vote.
See more:
I have a problem with my current project ,

It have a features of upload excel file ,
i was using epp plus to create it ,

now there was a problem after deploy my app,

i have test on my own pc ,and it was successfully ,

but when i deploy and another user use the features ,it show an error ,

After check the error, i think excel file not succesfully uploaded into temporary folder ,

What I have tried:

I am not sure about the cause ,but i think it can be cause by connection,

but how can i solve this,

is there another way,
can anyone please help me?
Posted
Updated 5 days ago
Comments
OriginalGriff 26-Jun-20 3:23am
   
"it show an error" doesn't help us at all: what message does it give?
What code is running that gives the error?

We can't tell, and there are loads of possible errors, and loads of possible causes for each of them. Without at least the error message and probably the relevant code fragment we can't help you.

Use the "Improve question" widget to edit your question and provide better information.
Member 14760154 26-Jun-20 3:45am
   
this is the error message
"System.IndexOutOfRangeException: Worksheet position out of range."

Line 165: ExcelWorksheet worksheet = package.Workbook.Worksheets[1];

when i check ,the excel file doesn't exists in temporary folder
F-ES Sitecore 26-Jun-20 11:08am
   
Check you have the permissions to write to the folder you are writing to. For asp.net if you want to save files you should put them in app_data
Rate this:
Please Sign up or sign in to vote.

Solution 1

Collections in C# are zero-based. If you want the 1st worksheet, try this:

ExcelWorksheet worksheet = package.Workbook.Worksheets[0];
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

Can you elaborate more so that we can help on exact issue?
   
Comments
Richard Deeming 2 days ago
   
If you want to ask for more information, click the "Have a Question or Comment?" button under the question and post a comment. Do not post your comment as a "solution" to the question.
Sweety K 2 days ago
   
Richard, I did that by mistake

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100