473,387 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Download, Zip, and extract

We have created a game and when the user click on "Download New Songs"
which requires the user to download songs.

This could be over 20 songs.
I have these files zipped on the server in one *.zip file.

Is there any c++ code, or library that could help me do the following.

Download zip file to users computer.
Unzip the file and extract the files into songs subdirectory.
Delete the zip file.

Can this be done?

Aug 19 '06 #1
7 3357
John wrote:
We have created a game and when the user click on "Download New Songs"
which requires the user to download songs.

This could be over 20 songs.
I have these files zipped on the server in one *.zip file.
MP3 format is already compressed, so ZIPping them just adds clutter.
Is there any c++ code, or library that could help me do the following.
You should use Google Groups to find either the answer or the best forum for
your question. This newsgroup is only qualified to discuss the raw C++
language itself. Your OS will have downloading functions.

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
Aug 19 '06 #2
Is there any c++ code, or library that could help me do the
following.
>
Download zip file to users computer.
Unzip the file and extract the files into songs subdirectory.
Delete the zip file.

Can this be done?
Of course, why couldn't it be done? I'm sure there are libraries which
can do this. Curl could probably do the download part ( depending on
the protocol you need ). But all third party libraries are off topic
in this newgroup.

-Brian

Aug 19 '06 #3

Phlip wrote:
John wrote:
We have created a game and when the user click on "Download New Songs"
which requires the user to download songs.

This could be over 20 songs.
I have these files zipped on the server in one *.zip file.

MP3 format is already compressed, so ZIPping them just adds clutter.
Where did the OP state MP3 is the format? I must have missed that.
There are may audio formats other than MP3.

-Brian

Aug 19 '06 #4
In article <11*********************@m79g2000cwm.googlegroups. com>,
wo**@brianmielke.com says...

[ ... ]
This could be over 20 songs.
I have these files zipped on the server in one *.zip file.
MP3 format is already compressed, so ZIPping them just adds clutter.

Where did the OP state MP3 is the format? I must have missed that.
There are may audio formats other than MP3.
There are other formats, but most are already compressed, so the same
comments apply. Zip will do some good on a pure PCM file (e.g. .wav
file) but that's just about it -- and something like MP3 or ogg will
compress the same file a LOT more.

OTOH, if you view zip as a pure archiver, it's not particularly terrible
-- most implementations of zip are smart enough to just store files that
won't compress, and the software to extract from the archive and such
are probably more widely available than for most pure archivers like ar.

--
Later,
Jerry.

The universe is a figment of its own imagination.
Aug 19 '06 #5
BigBrian wrote:
This could be over 20 songs.
I have these files zipped on the server in one *.zip file.

MP3 format is already compressed, so ZIPping them just adds clutter.

Where did the OP state MP3 is the format? I must have missed that.
There are may audio formats other than MP3.
You may have missed the question is off-topic. Hence I can say anything I
like, so long as I bounce. And please note everything I said was true.

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
Aug 19 '06 #6
"John" <ko*****@nextlevelsw.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
We have created a game and when the user click on "Download New Songs"
which requires the user to download songs.

This could be over 20 songs.
I have these files zipped on the server in one *.zip file.

Is there any c++ code, or library that could help me do the following.

Download zip file to users computer.
Unzip the file and extract the files into songs subdirectory.
Delete the zip file.

Can this be done?
Yes. google search for what you need and add "c++ source" after it. I have
found a socket class source that way (download zip file to users computer)
and zip source (extract the files into songs subdirectory). Deleting the
zip file is trivial.
Aug 19 '06 #7
Hi,

If you are on MS-Windows you might want to user the internet api, below is
an example of some part of my own program that ftp's files (this part
doesn't send files but if you lookup the api that is pretty easy to add).:

If you can decide how the files are compressed you could 'gzip' them and
unzip them with zlib library (works on ms-windows (by linking you program to
zlib.lib) as well as on most linux/unix systems (by including libz.a or
libz.so to your prorgram) (http://www.zlib.net/). This library is very easy
to use.

Regards, Ron AF Greve





---------------------------------------------------------------------------------------
#include <shlwapi.h>
#include <shlobj.h>
#include <afxpriv.h>

if( InternetAttemptConnect( 0 ) == ERROR_SUCCESS )
{

if( !( Session = InternetOpen( Server, INTERNET_OPEN_TYPE_DIRECT, 0, 0,
0 ) ) )
{
AfxMessageBox( _T( "Could setup internet session" ) );
Succeeded = false;
}
else
{

if( !( Connection = InternetConnect( Session, Server,
INTERNET_DEFAULT_FTP_PORT, User,
Password, INTERNET_SERVICE_FTP, 0, 0 ) ) )
{
AfxMessageBox( _T( "Could not establish ftp session" ) );
Succeeded = false;
}
else
{
if( !FtpSetCurrentDirectory( Connection, RemoteDir ) )
{
AfxMessageBox( _T( "Could not set current dir" ) );
Succeeded = false;
}
else
{
if( !FtpCreateDirectory( Connection, _T( RemoteDir + "/" +
RelBackup ) ) )
{
//AfxMessageBox( _T( "Could not set current dir" ) );
//Succeeded = false;

}
}
}
}
}
--
Regards, Ron AF Greve

http://moonlit.xs4all.nl

"John" <ko*****@nextlevelsw.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
We have created a game and when the user click on "Download New Songs"
which requires the user to download songs.

This could be over 20 songs.
I have these files zipped on the server in one *.zip file.

Is there any c++ code, or library that could help me do the following.

Download zip file to users computer.
Unzip the file and extract the files into songs subdirectory.
Delete the zip file.

Can this be done?

Aug 19 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rob Ketzscher | last post by:
This is probably extremely easy for most of you, but how do I download the source code of a web page? Say I got an applet and when I press a button it will then go download the HTML source code...
2
by: Lydia Shawn | last post by:
hi, how can i extract the number between text1 and text2 in input.html only the first time it occurs ignoring the rest? preferably input.html would be a URL that stops downloading once a match...
7
by: SunRise | last post by:
Hi I am creating a C Program , to extract only-Printable-characters from a file ( any type of file) and display them. OS: Windows-XP Ple help me to fix the Errors & Warnings and explain...
6
by: Selen | last post by:
I would like to be able to extract a BLOB from the database (SqlServer) and pass it to a browser without writing it to a file. (The BLOB's are word doc's, MS project doc's, and Excel spreadsheets....
3
by: VP Borza | last post by:
can anyone show me how can I extract icons from a dll or exe in visual basic ..net?
0
by: Vjay77 | last post by:
I posted this question, but I pressed 'post' and it disappeared. So once again: Problem: I need to go to lets say www.site.com/page.html Imagine that this html code is 6 mb long. I need to...
2
by: Elric02 | last post by:
I'm currently trying to get access to the Python source code, however whenever I try to extract the files using the latest version of WinZip (version 10) I get the following error "error reading...
2
by: shailen | last post by:
Hello, I have got the link of a running PHP script on a website, when when I try to download it, I get a plain HTML file which opens as the original website. I have tried to paste the link in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.