Zip Function

General discussion about netjukebox
Post Reply
User avatar
emcquaid
User
Posts: 23
Joined: Mon Sep 12, 2005 12:09 am
Location: Dallas, TX, USA, Earth, Milky Way Galaxy, Universe
Contact:

Zip Function

Post by emcquaid »

When I click on "Download Album" I get the album tracks with checks by them and "Download zip file (0.00 bytes)"

When I click on that it tells me "Can't open zip file. Most likely the zip file is already be downloaded and deleted."

Any ideas?

Thanks

Eric
User avatar
wbartels
netjukebox developer
Posts: 872
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Post by wbartels »

For this you need the latest version of 7zip (included in the latest codec pack).
And set the appropriate path for $cfg['codec_dir'].

When selecting an other Download Profile then "source"
you also need an encoder and decoder for transcoding (also included in the codec pack).
User avatar
emcquaid
User
Posts: 23
Joined: Mon Sep 12, 2005 12:09 am
Location: Dallas, TX, USA, Earth, Milky Way Galaxy, Universe
Contact:

Post by emcquaid »

I have the latest 7za.exe and the codec path is set.

If I remove the last two \\ from the codec path I get a different response. Create zip file.... but this status never changes. How long should it take to zip an album?

Thanks,

Eric
User avatar
wbartels
netjukebox developer
Posts: 872
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Post by wbartels »

\\ is realy needed on Windows!

For example:

Code: Select all

$cfg['codec_dir']                  = 'D:\Console\Codec\\';
$cfg['download_album_pack']        = $cfg['codec_dir'] . '7za.exe a -mx0 -tzip -scswin %destination @%list';
Will be concat as:

Code: Select all

$cfg['download_album_pack'] = 'D:\Console\Codec\7za.exe a -mx0 -tzip -scswin %destination @%list';
So far I only have tested the download feature on Apache and IIS on Windows.
I was forgotten to mention to use the latest beta version of 7zip.
http://prdownloads.sourceforge.net/seve ... p?download
(or use the latest codec from the netjukebox download page)
Only this version supports the "-scs" switch for character set.

320 MB takes less than 15 seconds on a Celeron Pentium IV 2,4 GHz.

If you use Linux/Unix/OSX try to comment out line 154 from download.php.

Code: Select all

$source = iconv('ISO-8859-1', 'CP850', $source);
And change "ISO-8859-1" to your local character set.
And use "-scsdos" in the config.inc.php file or use 7zip stable without this feature.
User avatar
emcquaid
User
Posts: 23
Joined: Mon Sep 12, 2005 12:09 am
Location: Dallas, TX, USA, Earth, Milky Way Galaxy, Universe
Contact:

Post by emcquaid »

the 7za from the codec page gets me a little furthur. Now I get "Download zip file (74.47 MB)". When I click on that I get the choice to save to disk or open file with winzip. Save to file only saves 2 mb of the file... open to winzip tells me "cannot open file: not a valid archive."
User avatar
wbartels
netjukebox developer
Posts: 872
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Post by wbartels »

emcquaid wrote:the 7za from the codec page gets me a little furthur. Now I get "Download zip file (74.47 MB)". When I click on that I get the choice to save to disk or open file with winzip. Save to file only saves 2 mb of the file... open to winzip tells me "cannot open file: not a valid archive."
That is strange :?
The 74.47 MB is the filesize from the physical zip file in the temp directory.

Will you try this out?
1) Download another album.
2) Write down the file size.
3) Go with your mouse over "Download zip file (xx.xx MB)"
and write down the 10 digits after "netjukebox/download.php?command=downloadalbum&album_id="
4) Go to the "netjukebox/temp/" directory and look for "username_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_10digits"
5) In that directory must be a zip file with the same size you have written down.

Is the filesize the same?
Can you open the zip file from the temp directory?

Please let me know your findings,

Willem
User avatar
emcquaid
User
Posts: 23
Joined: Mon Sep 12, 2005 12:09 am
Location: Dallas, TX, USA, Earth, Milky Way Galaxy, Universe
Contact:

Post by emcquaid »

Download zip file (37.85 MB)
who's link is:
http://192.168.1.34/netjukebox/download ... bnhybddrpw

when I go to the server netjukebox/temp directory I see a folder called:
admin_395ad17047f355d51c349a7831095fe5d653761f_bnhybddrpw

inside I see:
bnhybddrpw.txt 2 KB
bnhybddrpw.zip 38,755 KB

bnhybddrpw.zip opens just fine and everything is there.

Also, I tried to do this on the server machine and same result.

Also tried using both Firefox(my default browser) and IE. Same result.

Weird: every file saved comes out to 1.90 MB (2,000,000 bytes). These numbers are from right-clicking on the file and looking at the properties.
when I look at them in Windows Explorer the size is always the same 1,954 KB.

hmmm. I'm sure this all means something to you, Willem?

Thanks for your help. I will LOVE this feature and use it once I get it working.

Cheers,


Eric
User avatar
wbartels
netjukebox developer
Posts: 872
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Post by wbartels »

The file size is correct: 38755 KB / 1024 = 37.85 MB
And as you said the zip file can be opened.
The browser can't be the problem because they both give the same result.

I suspect the problem must be in the PHP and or web server configuration.
Witch web server and PHP version do you use?
User avatar
emcquaid
User
Posts: 23
Joined: Mon Sep 12, 2005 12:09 am
Location: Dallas, TX, USA, Earth, Milky Way Galaxy, Universe
Contact:

Post by emcquaid »

Apache Version Apache/2.0.54 (Win32) PHP/5.0.4
Apache API Version 20020903
User avatar
wbartels
netjukebox developer
Posts: 872
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Post by wbartels »

In the past I had a lot of problems streaming and downloading with the early PHP 5 versions.
Until the previous version of netjukebox I even had a fix for it:

Code: Select all

if (version_compare(phpversion(), '5.0.0', '>='))
	{
	$filehandle = @fopen($file, 'rb') or exit();
	while (!feof($filehandle))
		echo fread($filehandle, 1024 * 1024);
	fclose($filehandle);
	}
else
	@readfile($file);
But with the current PHP 5 version this fix isn't needed any more.
I think you will solve the problem when updating PHP.
User avatar
wbartels
netjukebox developer
Posts: 872
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Post by wbartels »

Google, google the google :wink:

You may not believe it but it is a PHP 5.0.4 bug:
http://bugs.php.net/bug.php?id=32970
http://bugs.php.net/bug.php?id=32553
User avatar
emcquaid
User
Posts: 23
Joined: Mon Sep 12, 2005 12:09 am
Location: Dallas, TX, USA, Earth, Milky Way Galaxy, Universe
Contact:

Post by emcquaid »

Truly amazing.

Thank you, Willem.

Happy Easter.


Cheers,


Eric
User avatar
wbartels
netjukebox developer
Posts: 872
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Post by wbartels »

emcquaid wrote:Happy Easter.
The same to you,

Willem
User avatar
emcquaid
User
Posts: 23
Joined: Mon Sep 12, 2005 12:09 am
Location: Dallas, TX, USA, Earth, Milky Way Galaxy, Universe
Contact:

Post by emcquaid »

Upgrade to PHP 5.1.2 was a little rocky, but it fixed the problem!

Thanks for your help.

Cheers,


Eric
Post Reply