Giter Site home page Giter Site logo

fortunen / cordova-plugin-zeep Goto Github PK

View Code? Open in Web Editor NEW
28.0 5.0 37.0 477 KB

Zip compression/decompression for the cordova/phonegap platform

License: Apache License 2.0

Java 1.25% C 81.71% Objective-C 8.29% JavaScript 2.27% C# 6.24% Batchfile 0.03% Shell 0.03% CSS 0.01% HTML 0.17%
cordova cordova-plugin cordova-android cordova-ios cordova-plugin-zeep cordova-android-plugin zip-compression decompression phonegap unzip

cordova-plugin-zeep's People

Contributors

fortunen avatar harha avatar nuvlar avatar sboyina avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cordova-plugin-zeep's Issues

Failed while locating

While zipping/unzipping the file it says zip error: failed while locating : test ({"code":5}) May I know why does it show me this !!

size limitation?

The plugin works fine on iOS11 for files sized a couple of MB up to a few dozen MB.
However the errorCallback is called immediately when the app tries to unzip a file that is 2.8 GB big using the same code like the one for the smaller files.

Is there some sort of limitation on how big a zip file can be?

Failed to instantiate module ngCordova.plugins.zeep

hey,guy。i put ngCordova.plugins.zeep in App.js file like that:
angular.module('starter', ['ionic', 'starter.controllers', 'starter.services','ngCordova','ngCordova.plugins.zeep']).
That will appear error.

ncaught Error: [$injector:modulerr] Failed to instantiate module starter due to:
Error: [$injector:modulerr] Failed to instantiate module ngCordova.plugins.zeep due to:
Error: [$injector:nomod] Module 'ngCordova.plugins.zeep' is not available!

unzipped file is different from original

Thanks for creating the plugin!

However, it seems its not correct when unzipping binary files.

I tried creating a random file, and when comparing the original file with the unzipped version the files are different!

Since I could not find any examples online this is how the test file was created:

dd if=/dev/urandom bs=100k count=1 of=random.raw; zip test.zip random.raw

I can also provide the test files I used if that's easier for you.

Thanks!

unzip behaves weirdly on windows

from: ms-appdata:///local/LOCALSTORAGE_BACKUP.bak
to: ms-appdata:///local/demo/

On android, this 'demo' folder is created upon unzip if it doesn't exist + .bak file contents are unzipped there correctly. On windows (Windows 10, UWP) it is created but it remains empty, meaning no files were actually unzipped from the .bak archive into the destination folder.

More weirdness: I tried this as output: ms-appdata:///local/demo/data.json, I knew it wouldn't work since it is by definition just asking for the folder path where to extract. To my surprise it created data.json folder and it did contain the extracted files.

Something weird going on there, I'm quite sure about that. I'm using cordova-plugin-file and cordova-plugin-zeep both. Everything works on android, nearly everything works on windows (unzip is only thing that has problems AFAIK).

Good job on the plugin so far! (y)

Doesn't extract but success OK

I'm not clear on how this plugin supposed to work but it clearly fails to extract the zip. Here is my code;

download: function(){

        app.downloadZip('1535',
            function _onProgress(fileDownloader) {
                console.log('Progress: ', fileDownloader);
/*
                var downloadProgress = parseFloat(fileDownloader.downloadProgress);
                downloadProgress =  Math.round(downloadProgress * 100);
                console.log('Progress: ', downloadProgress);
*/
            },
            function _onSuccess(entry) {
                console.log('Entry: ', entry);


                presenter.fileSystem.createDirectory(config.appDirName + '/1535',
                    function __onSuccess() {
                        console.log('Done!');
                        app.extract(entry);
                    },
                    function __onError(error) {
                        onError(error);
                    }
                );

            },
            function _onAbort() {
            },
            function _onError(error) {
                console.log('error: ', error);
            }
        );
    },

downloadZip: function(zip, onProgress, onSuccess, onAbort, onError) {

        var url = 'http://companyapp.co.uk/1535.zip';

        app.fileDownloader.remoteURL = url;
        app.fileDownloader.localFilePath = config.appDirName + '/' + '1535.zip';
        app.fileDownloader.bytesToDownload = '2435379';

        app.fileDownloader.download(options = { trustAllHosts: true},
            function _onProgress() {
                onProgress(presenter.fileDownloader);
            },
            function _onSuccess(zip) {
                onSuccess(zip);
            },
            function _onAbort() {
                onAbort();
            },
            function _onError(error) {
                onError(error);
            }
        );
    }

extract: function(entry){

      var zip = entry.nativeURL;
      var extracted = entry.name.split('.');
          extracted = extracted['0'];

      var fs = presenter.fileSystem.getFS();

      fs.root.getDirectory(config.appDirName + '/' + extracted, { create: false },
          function(presFolder){
              console.log(presFolder);
              Zeep.unzip({
                  from : zip,
                  to   : presFolder.nativeURL
              }, function(e) {
                  console.log('success: ', e);
                  // print out: success:  OK
              }, function(e) {
                  console.log('error: ', e);
              });
          },
          function(e){
              console.log(e)
          }
      );
    },

Zip one single file

Instead of zipping up the entire folder how can we pass a single file name?

How to import in ionic 3?

I need an example like this, but using ionic 3, importing with ts e etc:

app = angular.module('MyApp', ['ngCordova.plugins.zeep'])
app.controller('MyController', function($scope, $cordovaZeep) {
    
    var source    = cordova.file.applicationDirectory,
        zip       = cordova.file.cacheDirectory + 'source.zip',
        extracted = cordova.file.cacheDirectory + 'extracted';
    
    console.log('source    : ' + source   );
    console.log('zip       : ' + zip      );
    console.log('extracted : ' + extracted);
    
    console.log('zipping ...');
    
    $cordovaZeep.zip({
        from : source,
        to   : zip
    }).then(function() {
        
        console.log('zip success!');
        console.log('unzipping ...');
        
        $cordovaZeep.unzip({
            from : zip,
            to   : extracted
        }).then(function() {
            console.log('unzip success!');
        }, function(e) {
            console.log('unzip error: ', e);
        });
        
    }, function(e) {
        console.log('zip error: ', e);
    });
    
});

open failed: ENOTDIR (Not a directory) when calling zeep.unzip

HI, I am getting the following error when calling zeep.unzip in an android cordova application:

/data/user/0/com.testApp.test/cache/1.0.0.0/www/test/test.html: open failed: ENOTDIR (Not a directory)"

I've been able to use this on an emulator with no problem. However, when attempting to use it on a physical Samsung Galaxy Tab3 I get the above exception message.

Any idea, what would cause this or how to work around it?

Multiple File Zip

Hi Team,

I need to generate one zip file containing multiple pdf file and one text file.

Is it possible to achieve same using this plugin.?

If yes, how can I achieve this.

Unable to submit app to App Store

ITMS-90338: Non-public API usage - The app references non-public selectors in ***: _setAlwaysRunsAtForegroundPriority:, zipArchiveDidUnzipFileAtIndex:totalFiles:archivePath:unzippedFilePath:, zipArchiveProgressEvent:total:. If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed. For further information, visit the Technical Support Information at http://developer.apple.com/support/technical/

iOS not builds in Ionic (Error code 65)

** BUILD FAILED **

The following build commands failed:
CompileC /Users/user13/Library/Developer/Xcode/DerivedData/RAFX-gxtuhbgatrmuldfktgoiriftpbnn/Build/Intermediates.noindex/RAFX.build/Debug-iphonesimulator/RAFX.build/Objects-normal/x86_64/FiNeZeep.o RAFX/Plugins/cordova-plugin-zeep/FiNeZeep.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/user13/Desktop/RAFX-A/RAFX/platforms/ios/cordova/build-debug.xcconfig,-workspace,RAFX.xcworkspace,-scheme,RAFX,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone X,build,CONFIGURATION_BUILD_DIR=/Users/user13/Desktop/RAFX-A/RAFX/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/user13/Desktop/RAFX-A/RAFX/platforms/ios/build/sharedpch

[ERROR] An error occurred while running cordova build ios (exit code 1).

Plugins:
cordova-clipboard 1.1.1 "Clipboard"
cordova-plugin-camera 4.0.1 "Camera"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-filepath 1.0.2 "FilePath"
cordova-plugin-filepicker 1.1.4 "File Picker"
cordova-plugin-inappbrowser 2.0.2 "InAppBrowser"
cordova-plugin-ionic 4.1.3 "IonicCordova"
cordova-plugin-ionic-webview 1.1.16 "cordova-plugin-ionic-webview"
cordova-plugin-media 5.0.2 "Media"
cordova-plugin-nativeaudio 3.0.9 "Cordova Native Audio"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-whitelist 1.3.1 "Whitelist"
cordova-plugin-x-socialsharing 5.2.1 "SocialSharing"
cordova-plugin-zeep 0.0.4 "Zeep"
es6-promise-plugin 4.1.0 "Promise"
ionic-plugin-keyboard 2.2.1 "Keyboard"

Can you help, please? Maybe this related with cordova-plugin-ionic?

Encrypted ZIP entry not supported

Trying to unzip with password a external generated zip with password gives the next error:

unzip error: encrypted ZIP entry not supported

I also try with a MacOSX zip file with password and gives the same error.

cordova-plugin-zeep for WIndows 10

Hi, Raj here. I didn't know how to approach this team so raising this as an issue though it is not. I have added windows 10 functionality to this plugin, modifying the FineZeep portable CS project to a UWP extension. I know there are lot of people out there looking to compress/decompress files in cordova apps on Windows10. Please let me know how I can contribute.

BTW, i removed the dependency on CSharpZipLib. Using UWP IO Compression features.

issue with unzipping pngs

Hello,

we are trying to use your plugin for unzipping maptiles of png datatype. The result we get is a partly correct png with pixel errors in it. have a look at the attachment.

726

would be nice if you could help, otherwise the plugin works nicly!

unzip to same directory as zip ?

At least in the windows version it seems you can't extract into the same directory as where the zip file is ?

In my case it would make more sense than having a new directory for unzipped files.

Thanks

add plugin warning

Configure project :
Configuration 'compile' in project ':' is deprecated. Use 'implementation' instead.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_2mypztukcdnygbbz3tlgc3s5n.run(D:\Projects\EpmUserAppSvn\trunk\EpmAppCode\EpmUserApp\platforms\android\build.gradle:139)

Configure project :CordovaLib
publishNonDefault is deprecated and has no effect anymore. All variants are now published.

unzip() failed to create folder in Android 8.1

Error message in console:
unzip failed: /data/user/0/com.tinkamo.tinkamoapp/files/play/gear_box/assets/7-tn.png (Not a directory)

I checked the folder with Android Studio's Device File Explorer and found the folders are not folders but some files with question marks, as shown below.
screen shot 2018-12-31 at 6 19 46 pm

I created the ZIP file using Mac OS X. Is there a compatibility issue of unzipping Mac-created zip on Android? Any one has the same issue?

only in android, unzip a folder is failing with ENOTDIR error

In android mobile, invoking zeep.unzip method is throwing error as "Open failed: ENOTDir (Not a directory)"

In android, I have a zip file containing the following structure
--- testFile.zip
------------ testFolder
--------------------- test.png

i.e. any file it can be a .txt or .png file inside a folder and zip this folder.
While trying to unzip this folder, Not a directory error is thrown.

But ios works fine.

Why this issue occurs ?

Can I unzip a file with password?

Hello!

Thx for the plugin. I need to unzip my file using a password. Can I do with your plugin? Whats the command to do "if i can"?

Thx Again!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.