Click here to Skip to main content
14,665,437 members
Home » Discussions » .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Application wide information into classes in referenced DLL's Pin
watchmeoni9-Mar-20 14:18
Memberwatchmeoni9-Mar-20 14:18 
AnswerRe: Application wide information into classes in referenced DLL's Pin
Mycroft Holmes28-Jan-20 10:13
professionalMycroft Holmes28-Jan-20 10:13 
GeneralRe: Application wide information into classes in referenced DLL's Pin
A D Rosser29-Jan-20 5:17
MemberA D Rosser29-Jan-20 5:17 
GeneralRe: Application wide information into classes in referenced DLL's Pin
Mycroft Holmes29-Jan-20 10:31
professionalMycroft Holmes29-Jan-20 10:31 
QuestionHow to export multiple image to excel in .Net core Pin
Member 1422622525-Jan-20 4:52
MemberMember 1422622525-Jan-20 4:52 
QuestionSubtract number for each row from datagridview1 to datagridview2 and display to answer to datagridview3 Pin
percy0521-Jan-20 15:32
Memberpercy0521-Jan-20 15:32 
AnswerRe: Subtract number for each row from datagridview1 to datagridview2 and display to answer to datagridview3 Pin
Richard MacCutchan21-Jan-20 21:32
mveRichard MacCutchan21-Jan-20 21:32 
QuestionGetting Error System.IO.InvalidDataException: 'End of Central Directory record could not be found Pin
simpledeveloper2-Jan-20 8:10
Membersimpledeveloper2-Jan-20 8:10 
I have method which was working fine with PDFs has started giving errors, I checked in TFS - I didn't find any changes in that part of the method, I am getting the error: System.IO.InvalidDataException: 'End of Central Directory record could not be found.', but the PDF is valid and other clients told me it has started throwing errors for the pdfs previously were working. Here is the code:
try
                {
                    using (MemoryStream ms = new MemoryStream(fileData))
                    {                        
                        List<string> dangerous_files = new List<string>();
                        string msgModel = "ZIP: {zip} - ({file})";
                        using (ZipArchive archive = new ZipArchive(ms))
                        {
                            foreach (var entity in archive.Entries)
                            {
                                if (denyExtensions.Contains(entity.FullName.Split('.').LastOrDefault().ToLower()))
                                {
                                    dangerous_files.Add(msgModel.Replace("{zip}", GetRidOfSlash(file.FileName)).Replace("{file}", entity.FullName));
                                }
                            }
                            if (dangerous_files.Count > 0)
                            {
                                Response.TrySkipIisCustomErrors = true; Response.StatusCode = 500;
                                return Json(new
                                {
                                    error = errMsg,
                                    code = "500.1",
                                    files = dangerous_files
                                });
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    LogHandler.LogError(4203, "Zip file creation failed Upload - Picture", ex);
                    throw ex;
                }

The place where I am getting the errors is at the following line:
using (ZipArchive archive = new ZipArchive(ms))

Any help would be very very helpful - thanks in advance.
AnswerRe: Getting Error System.IO.InvalidDataException: 'End of Central Directory record could not be found Pin
Eddy Vluggen2-Jan-20 10:29
professionalEddy Vluggen2-Jan-20 10:29 
AnswerRe: Getting Error System.IO.InvalidDataException: 'End of Central Directory record could not be found Pin
Richard MacCutchan2-Jan-20 21:55
mveRichard MacCutchan2-Jan-20 21:55 
Questionwhat is tuple in mvc Pin
Anil Sharma198326-Dec-19 5:29
professionalAnil Sharma198326-Dec-19 5:29 
AnswerRe: what is tuple in mvc Pin
Pete O'Hanlon26-Dec-19 6:38
subeditorPete O'Hanlon26-Dec-19 6:38 
AnswerRe: what is tuple in mvc Pin
Eddy Vluggen26-Dec-19 11:42
professionalEddy Vluggen26-Dec-19 11:42 
QuestionSharpGL control on MDI Childwindow: Childwindow not sizable with mouse Pin
Member 1433546425-Dec-19 5:48
MemberMember 1433546425-Dec-19 5:48 
QuestionHow to get connection string of server and connect to it? Pin
SebGM2521-Dec-19 6:01
MemberSebGM2521-Dec-19 6:01 
AnswerRe: How to get connection string of server and connect to it? Pin
Eddy Vluggen21-Dec-19 10:38
professionalEddy Vluggen21-Dec-19 10:38 
QuestionRichTextBox Viewer Pin
Diex196819-Dec-19 4:25
MemberDiex196819-Dec-19 4:25 
AnswerRe: RichTextBox Viewer Pin
Eddy Vluggen21-Dec-19 10:41
professionalEddy Vluggen21-Dec-19 10:41 
GeneralRe: RichTextBox Viewer Pin
Gerry Schmitz22-Dec-19 3:24
mveGerry Schmitz22-Dec-19 3:24 
GeneralRe: RichTextBox Viewer Pin
Diex196822-Dec-19 7:08
MemberDiex196822-Dec-19 7:08 
QuestionGet list from list of elements link and collections Pin
simpledeveloper13-Dec-19 6:13
Membersimpledeveloper13-Dec-19 6:13 
AnswerRe: Get list from list of elements link and collections Pin
Richard Deeming13-Dec-19 6:29
mveRichard Deeming13-Dec-19 6:29 
GeneralRe: Get list from list of elements link and collections Pin
simpledeveloper13-Dec-19 8:24
Membersimpledeveloper13-Dec-19 8:24 
QuestionThe operation failed: The relationship could not be changed because one or more of the foreign-key - EF Code first Pin
simpledeveloper6-Dec-19 6:45
Membersimpledeveloper6-Dec-19 6:45 
AnswerRe: The operation failed: The relationship could not be changed because one or more of the foreign-key - EF Code first Pin
Gerry Schmitz6-Dec-19 7:29
mveGerry Schmitz6-Dec-19 7:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.