Quantcast
Channel: SharpDevelop Community
Viewing all articles
Browse latest Browse all 1764

Does any one know about this error: “Wrong Local header signature: 0x6D74683C”?

$
0
0

The question is also posted at stackoverflow:http://stackoverflow.com/questions/16253543/does-any-one-know-about-this-error-wrong-local-header-signature-0x6d74683c

----------------------------------------------------------------------------------------------------

The following code is used to download a zip file and unzip it on phone.

The same code used to work on WP7, I started tested on WP8 device, and strange thing is happening... now it works on WP8 but NOT on WP7 anymore.

On the WP7 it gives an ERROR:

WrongLocal header signature:0x6D74683C

Could someone tell me what's wrong here?

using ICSharpCode.SharpZipLib.Zip;
using System;
using System.Diagnostics;
using System.IO;
using System.IO.IsolatedStorage;
using System.Net;

namespace iq_main.Network{publicclass IQ_Download{privatestring zipFilePassword =String.Empty;privatestring fileNameToBeStoredAs =String.Empty;privatestring urlToBeDownloaded =String.Empty;privateHttpWebResponse response;publicvoidDownload(string _urlToBeDownloaded =GlobalConstants.DownloadLanguageConfigurationUrl,string _fileNameToBeStoredAs =GlobalConstants.DownloadLanguageConfigurationXmlFilename,string _zipFilePassword =GlobalConstants.DownloadZipsPassword){

            urlToBeDownloaded = _urlToBeDownloaded;
            fileNameToBeStoredAs = _fileNameToBeStoredAs;
            zipFilePassword = _zipFilePassword;System.Uri targetUri =newSystem.Uri(urlToBeDownloaded);HttpWebRequest request =(HttpWebRequest)HttpWebRequest.Create(targetUri);

            request.BeginGetResponse(newAsyncCallback(WebRequestCallBack), request);}voidWebRequestCallBack(IAsyncResult result){HttpWebRequest resultInfo =(HttpWebRequest)result.AsyncState;
            response =(HttpWebResponse)resultInfo.EndGetResponse(result);try{

                using (StreamReader httpwebStreamReader =newStreamReader(response.GetResponseStream())){//open isolated storage to save files
                    using (IsolatedStorageFile isoStore =IsolatedStorageFile.GetUserStoreForApplication()){
                        using (ZipInputStream s =newZipInputStream(httpwebStreamReader.BaseStream)){if(zipFilePassword !=String.Empty)
                                s.Password= zipFilePassword;//if archive is encryptedZipEntry theEntry;try{//EXCEPTION OCCURS ON THE VERY NEXT LINE (while...)    while((theEntry = s.GetNextEntry())!=null){string directoryName =Path.GetDirectoryName(theEntry.Name);string fileName =Path.GetFileName(theEntry.Name);
                                    fileName = fileNameToBeStoredAs;// create directoryif(directoryName.Length>0){
                                        isoStore.CreateDirectory(directoryName);//Directory.CreateDirectory(directoryName);}if(fileName !=String.Empty){//save file to isolated storage
                                        using (BinaryWriter streamWriter =newBinaryWriter(newIsolatedStorageFileStream(theEntry.Name,FileMode.Create,FileAccess.Write,FileShare.Write, isoStore))){int size =2048;byte[ data =newbyte[2048];while(true){
                                                size = s.Read(data,0, data.Length);if(size >0)
                                                    streamWriter.Write(data,0, size);elsebreak;}}}}}catch(ZipException ze){Debug.WriteLine(ze.Message);}}}}}//trycatch(Exception ex){Debug.WriteLine(ex.Message);}}//WebRequestCallBack Method */}//Class ends}

THE OUTPUT STACK

'TaskHost.exe'(Managed):Loaded'\Applications\Install\2886244C-2244-44C3-BD94-809442B9CDEF\Install\URKeyboard.dll',Symbols loaded.'TaskHost.exe'(Managed):Loaded'\Applications\Install\2886244C-2244-44C3-BD94-809442B9CDEF\Install\WP7DockPanel.dll''TaskHost.exe'(Managed):Loaded'\Applications\Install\2886244C-2244-44C3-BD94-809442B9CDEF\Install\System.Threading.Tasks.dll''TaskHost.exe'(Managed):Loaded'\Applications\Install\2886244C-2244-44C3-BD94-809442B9CDEF\Install\Microsoft.Threading.Tasks.dll' A first chance exception of type 'System.MethodAccessException' occurred in mscorlib.dll'TaskHost.exe'(Managed):Loaded'\Applications\Install\2886244C-2244-44C3-BD94-809442B9CDEF\Install\Microsoft.Threading.Tasks.Extensions.Phone.dll' A first chance exception of type 'System.MethodAccessException' occurred in mscorlib.dll'TaskHost.exe'(Managed):Loaded'System.Runtime.Serialization.dll''TaskHost.exe'(Managed):Loaded'System.SR.dll' A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll A first chance exception of type 'System.IO.IsolatedStorage.IsolatedStorageException' occurred in mscorlib.dll A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll A first chance exception of type 'System.IO.IsolatedStorage.IsolatedStorageException' occurred in mscorlib.dll'TaskHost.exe'(Managed):Loaded'\Applications\Install\2886244C-2244-44C3-BD94-809442B9CDEF\Install\SharpZipLib.WindowsPhone7.dll'Stepinto:Stepping over method without symbols 'string.operator !='Stepinto:Stepping over method without symbols 'ICSharpCode.SharpZipLib.Zip.ZipInputStream.Password.set'Stepinto:Stepping over method without symbols 'string.operator !='Stepinto:Stepping over method without symbols 'ICSharpCode.SharpZipLib.Zip.ZipInputStream.Password.set'Stepinto:Stepping over method without symbols 'ICSharpCode.SharpZipLib.Zip.ZipInputStream.GetNextEntry' A first chance exception of type 'ICSharpCode.SharpZipLib.Zip.ZipException' occurred inSharpZipLib.WindowsPhone7.dllStepinto:Stepping over method without symbols 'System.Exception.Message.get'Stepinto:Stepping over method without symbols 'System.Diagnostics.Debug.WriteLine'WrongLocal header signature:0x6D74683C A first chance exception of type 'ICSharpCode.SharpZipLib.Zip.ZipException' occurred inSharpZipLib.WindowsPhone7.dllWrongLocal header signature:0x6D74683C


 

 


Viewing all articles
Browse latest Browse all 1764

Trending Articles