CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Using gzip, tar and variable conversion.

 



skirrow
stranger

Jul 18, 2002, 4:36 AM

Post #1 of 3 (418 views)
Using gzip, tar and variable conversion. Can't Post

Hi,
1st question, what's the mime type for ZIP and TAR files?

2nd question, I'm currently developing a download script for my web site. It will allow the user to choose which script they wish to download and then have it emailed to them. The scripts will be zipped on the fly when the user requests for reasons I won't go into. I was wondering what the implications of doing this are, is it going to be a server hog running gzip and tar commands all day or is it not a problem? The zip file sizes ranges from around 15Kb to 100Kb and are downloaded between 100 - 300 times a day. Occasionally they are downloaded over 10,000 times in one day when new versions of the script are released. Any comments?

3rd question, how do I take a variable with a value for example, house and convert it into the format $h, $o, $u, $s, $e? The length of word will vary.

Thanks for your time!
- Neil
--
http://www.locked-area.com/
http://www.opencrypt.com/


davorg
Thaumaturge / Moderator

Jul 18, 2002, 5:14 AM

Post #2 of 3 (416 views)
Re: [skirrow] Using gzip, tar and variable conversion. [In reply to] Can't Post


In Reply To
Hi,
1st question, what's the mime type for ZIP and TAR files?


zip is application/zip
tar is application/x-tar but you'd be better off supplying gzipped tar files as tar does no compression
gz is application/x-gzip


In Reply To
2nd question, I'm currently developing a download script for my web site. It will allow the user to choose which script they wish to download and then have it emailed to them. The scripts will be zipped on the fly when the user requests for reasons I won't go into. I was wondering what the implications of doing this are, is it going to be a server hog running gzip and tar commands all day or is it not a problem? The zip file sizes ranges from around 15Kb to 100Kb and are downloaded between 100 - 300 times a day. Occasionally they are downloaded over 10,000 times in one day when new versions of the script are released. Any comments?

Should be fine on your normal days. It'll certainly be a bit of a problem on the busy days.


In Reply To
3rd question, how do I take a variable with a value for example, house and convert it into the format $h, $o, $u, $s, $e? The length of word will vary.

I'm really not sure what you're asking there. You can split a string into individual components using "split". If you don't know how many letters it will be, then you should store the return value in an array.

Code
my @letters = split //, $string;



In Reply To
http://www.cgiscriptreview.com/

Any chance you could do a review of the nms programs at that site?

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks


skirrow
stranger

Jul 18, 2002, 5:48 AM

Post #3 of 3 (415 views)
Re: [davorg] Using gzip, tar and variable conversion. [In reply to] Can't Post

Thanks for your comments/help.

The reason for splitting the variable is as part of an anti-piracy system I am developing for my software.



In Reply To
Any chance you could do a review of the nms programs at that site?


Yes, I'm sure. I'm very busy with programming at the moment but once it's all out of the way I'll begin writing for CGIScriptReview.com again.

- Neil
--
http://www.locked-area.com/
http://www.opencrypt.com/

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives