Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Can you create your own folder names in zip and add into that?
notken
Junior Member

Posts: 4
Registered: 6/20/2007
Member Is Offline
posted on 6/20/2007 at 11:52 AM Reply With Quote
Can you create your own folder names in zip and add into that?


. I want to create a customised zip file with my own folder names within the zip so that I dona??t reveal the structure on our server. That is if I have a folder of:

Artwork
i?? Folder1
i?? Folder2
i?? Folder3

I would actually like to add those in to a zip file as:

Friendly_name
i?? Another friendly name
i?? A third friendly name
i?? A fourth friendly name

At the moment I have
Zip.KeepPaths = true
Zip.RootDirectory = path
Zip.RelativePaths = true

Which stores them in subdirectories, but they are the same as the ones we use internally. I want to create user-friendly ones that are more descriptive. I am manually adding Folder1, Folder2 and Folder3, so programmatically ita??s not a problem to create friendly folder names as I go. Is this possible?

Thanks for your help.
View User's Profile View All Posts By User U2U Member
wit
Member

Posts: 23
Registered: 11/19/2004
Member Is Offline
posted on 6/21/2007 at 10:41 AM Reply With Quote

There is not ability to change file paths in the result archive when you zip files, but you can change them after you zipped files

e.g.

Code:

//JScript
/*
Folder to zip
/FilesToZip
/DOC001
/DOC002
/DOC003

*/

var path = Server.MapPath("/FilesToZip");
var zipFileName = Server.MapPath("/result.zip");


zip.New(zipFileName);
zip.KeepPaths = true;
zip.RootDirectory = path;
zip.RelativePaths = true;

zip.FileList.Add("*.*");

zip.Save();


zip.Open(zipFileName);
zip.Read();
for (var i=0;i<zip.Count-1;i++)
{
if (zip.FilePathName(i) == "DOC001\\\\")
zip.FilePathName(i) = "Prospects\\\\";
else if (zip.FilePathName(i) == "DOC002\\\\")
zip.FilePathName(i) = "Drafts\\\\";
else if (zip.FilePathName(i) == "DOC003\\\\")
zip.FilePathName(i) = "Events\\\\";
}

if (zip.Modified)
zip.Save();



PS. FilePathName property changed to read/write in version 1.21 (before it was read-only). so if you have older version (you can find your zip component version in zip.Version property) send update request to [email protected]
View User's Profile View All Posts By User U2U Member
notken
Junior Member

Posts: 4
Registered: 6/20/2007
Member Is Offline
posted on 6/21/2007 at 06:06 PM Reply With Quote

Thanks for the quick reply. It looks like that will work, but I do have just version 1.0.

You can't actually e-mail support any more as it bounces back telling you to use the forum. So could you please let me know how to get hold of the latest version, or email it to me at steve dot owen at gamespress dot com?
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 6/21/2007 at 06:54 PM Reply With Quote

Doesn't it say to use the support system (which is not the same as forum)?
You can submit your request at http://www.softcomplex.com/support/
The login information is in your order confirmation email. You can create new account if you no longer have that email.
View User's Profile View All Posts By User U2U Member
notken
Junior Member

Posts: 4
Registered: 6/20/2007
Member Is Offline
posted on 6/22/2007 at 07:39 AM Reply With Quote

Oh, yes, you're right. Sorry. I thought it was the same thing. Have submitted a request. Thanks for your help.
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
Free Download Free Download
Product Documentation Documentation
Documenation Page
Code Samples
Support Forum Technical Support
Support Forum
Customer Care System
Order Now ORDER NOW!
Add to Cart
View Cart
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004