Closed CouinCouin closed 1 year ago
This works here. Try getting the latest version of the whole repository (all files).
If still not working the you can ZIP your non-working project and attach it here so I can take a peek.
Btw, there is no reason to use memory streams for what you are doing. Just using plain filenames is more efficient in your case.
Instead of
.AddFile pvInitMemStream("C:\TEMP\Ep.5 2017-06-25 (via E90).mp3"), "Ep.5 2017-06-25 (via E90).mp3"
just call
.AddFile "C:\TEMP\Ep.5 2017-06-25 (via E90).mp3", "Ep.5 2017-06-25 (via E90).mp3"
or even shorter
.AddFile "C:\TEMP\Ep.5 2017-06-25 (via E90).mp3"
With CompressArchive
call its the same -- no need to output to a memory stream at all, just call it with a string filename like this
bResult = .CompressArchive("C:\TEMP\Podcasts.zip", Level:=lLevel)
Don't fiddle with ReadBinaryFile
, WriteBinaryFile
and cMemoryStream
unless you have good reason to use these i.e. the source of the data to be compressed is not in files but for instance coming from the internet request or you need the output of the compression not in a file but sent to a serial port for instance.
The use-case for in-memory operations (which is what you are using here) is very specific and compressing MP3 files is not one of these.
Hi wqweto,
Thanks for help :)
I though that using memory was nrequiered to push the files to zip into a subfolder of my choice.
Just tested with changes you posted, it looks ok now , all files seems to be in the archive file, and this last is not corrupted.
(Also, mp3 files was just for testing with "big" files instead of several smalls).
Rest to implent creating subfolder when unzipping (in my project), but I think it will be also fine onece done.
Keep you informed :)
Hi :)
I'm near from achieve backup and restore feature, looks running well with Jingle Palette's sample files. And I tried with my jingles set (folder size is 788 MB but not all files are used), and on restoring , wow, a lot of jingles missing. Started to investigate, files are listed, but archive is corrupted, I can not read or extract any file in Windows explorer. Zip file size in 262 144 kB (in Size column of Explorer) Tried with removing files to archive, zip is no long corrupted since its under 262 144 kB.
Tried with some files with the test/basic project to rid of an eventually wrong code in my project.![image](https://user-images.githubusercontent.com/62549730/205813174-c63febcd-998a-41f6-92bd-47614fa8d911.png)
Here is the co, based on existing Command3_click :
The result is that only the Ep.2 2017-06-04 (Export FB mono).mp3 is in the zip file. About progress, I see that the other files are displayed for a short time than first , and percentage not goes to 100% (or near) for each file, but only around 30% max.
Some idea of what I do wrong ? (Of course, files are present and not bad).
Thanks :) Couin