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

UNABLE TO unCompress zip file which is saved in document directory. #24

Closed
narendra-ct opened this issue Jun 17, 2016 · 4 comments
Closed

Comments

@narendra-ct
Copy link

narendra-ct commented Jun 17, 2016

Hi,

Im able to download the zip file from my shared folder and if try to unzip manually (in MAC) it works fine, if try to unzip the file using iOS Library (SSZipArchive or ZipArchive) it throws an error as BADZIP file.
The problem with only downloaded files and normal files i can able to unzip through SSZipArchive.
Please help on this what i can do.

Thanks,
Narendra V.

@narendra-ct
Copy link
Author

While Download/Upload its creating more size than actual file size.

@narendra-ct
Copy link
Author

hello,

I have fixed this issue by using While loop instead of do-while for smb_fread .

Code as follows:

while ((bytesRead < self.file.fileSize))
{
@autoreleasepool {

        length = smb_fread(self.downloadSession, fileID, buffer, bufferSize);
        if (length != -1)
        {
            bytesRead += length;
            [fileHandle writeData:[NSData dataWithBytes:buffer length:length]];

            //Ensure the data is properly written to disk before proceeding
            [fileHandle synchronizeFile];

            self.countOfBytesReceived += length;

            [self didUpdateWriteBytes:length totalBytesWritten:self.countOfBytesReceived totalBytesExpected:self.countOfBytesExpectedToReceive];
        }
    }
}

@natalia-osa
Copy link
Contributor

natalia-osa commented Jun 20, 2016

This seems to be a duplicate of #17. Good solution anyway.

@narendra-ct
Copy link
Author

Yes, Im closing this.

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

2 participants