Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
7
Erster Beitrag:
vor 2 Jahren, 2 Monaten
Letzter Beitrag:
vor 2 Jahren, 2 Monaten
Beteiligte Autoren:
Yogi Yang, Danny Lauwers, Fabrice Harari, GuenterP

[WM] - Error in zipCreate()

Startbeitrag von Yogi Yang am 01.12.2015 12:19

Hello,

I am trying to use zipCreate in my Android app for create a zip file of the default data file. But I keep on getting this error message:
Quote

2: Access denied: the user has no sufficient rights


How to solve this problem?

TIA

Yogi Yang

Antworten:

Hi

as it looks like you don't have the right to write where you are writing, you should try in another directory

Best regards

von Fabrice Harari - am 01.12.2015 12:55
Thanks for feedback.
Quote
Fabrice Harari
as it looks like you don't have the right to write where you are writing, you should try in another directory

But if I copy a file in the target folder it works. So why is this function giving such an error then?

TIA

Yogi Yang

von Yogi Yang - am 02.12.2015 04:11
Hi Yogi, I had this "problem" recently too - simply under Windows 10. You have to understand the zipCreate function first .. the first parameter is not the phyiscal name of any archive, its just a logical reference to your archive, so, "MyArchive" is just fine, its like the file number for the f-functions, a reference for further handling of the file. The second parameter is the physical file name of the archive file, further operations will use the first parameter as an easy reference to the archive. The extension of the physical name decides about the type of the archive to be created. .zip for ZIP, .7z for 7-zip etc. Then, next commands in your program will add files and directories to the archive, zipAddDirectory, zipAddFile .. at last zipClose will close MyArchive and that's it.

von GuenterP - am 02.12.2015 06:18
Hello Guenter,

Thanks for the tip. I have used this in past in WD but now I am trying to us it in WM for an app which is targeted for Android.

TIA

Yogi Yang

von Yogi Yang - am 02.12.2015 07:34
Yogi,

The Android application can only write to SD Card or its own directory.

I am using the Zip command in Android and this is working fine.

I first create a ZIP by

zipCreate(sName,sLogPath7Z)


and then add files


zipAddFileList(sName,sFiles)


Files is a string containing the paths of the files needed to be added to the Archive, seperated by CR

And finaly, Close the ZIP


zipClose(sName)


Danny

von Danny Lauwers - am 02.12.2015 08:54

Re: [WM] - Error in zipCreate() **Solved**

Thanks everyone for your suggestions and tips.

The actual problem was with the Android Emulator created by AVD.

When I ran the app on physical mobile device it worked like a charm.

Thanks again.

Yogi Yang

von Yogi Yang - am 04.12.2015 04:03
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.