notken
Junior Member
Posts: 3
Registered: 6/20/2007
Member Is Offline
|
| posted on 6/20/2007 at 11:52 AM |
|
|
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 don’t reveal the structure on our server. That is if I
have a folder of:
Artwork
Folder1
Folder2
Folder3
I would actually like to add those in to a zip file as:
Friendly_name
Another friendly name
A third friendly name
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 it’s not a problem to create friendly folder names as I go. Is
this possible?
Thanks for your help.
|
|
|
wit
Member
Posts: 24
Registered: 11/19/2004
Member Is Offline
|
| posted on 6/21/2007 at 10:41 AM |
|
|
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 support@softcomplex.com
|
|
|
notken
Junior Member
Posts: 3
Registered: 6/20/2007
Member Is Offline
|
| posted on 6/21/2007 at 06:06 PM |
|
|
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?
|
|
|
tigra
Administrator
Posts: 1869
Registered: 6/17/2002
Location: US, CO
Member Is Offline
|
| posted on 6/21/2007 at 06:54 PM |
|
|
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.
|
|
|
notken
Junior Member
Posts: 3
Registered: 6/20/2007
Member Is Offline
|
| posted on 6/22/2007 at 07:39 AM |
|
|
Oh, yes, you're right. Sorry. I thought it was the same thing. Have submitted a request. Thanks for your help.
|
|
|