Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-12-2005, 11:32 AM
Member
 
Join Date: Oct 2004
Posts: 53
Default Read from inside Zip or Rar file

hi

is it possible for SWFKit to read a file from inside a password protected zip or rar file?

i plan to zip/rar a mdb file and password protect it. and from inside it access the mdb file.

any help will be greatly appreciated

thanks
Reply With Quote
  #2 (permalink)  
Old 10-17-2005, 01:43 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Read from inside Zip or Rar file

http://users.skynet.be/saw/

e.g.

Code:
var zip = new ActiveXObject("SAWZipNG.Archive");
zip.open("c:\\flyvideo20002040.zip");

for (i = 0; i < zip.count; i++)
{
var fi = zip.getFileInfo(i);
trace(fi.filename);
}
Reply With Quote
  #3 (permalink)  
Old 10-17-2005, 02:00 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Read from inside Zip or Rar file

// Generated .IDL file (by the OLE/COM Object Viewer)
//
// typelib filename: SAWZipNG.tlb

[
uuid(D4C11DA3-8B64-11D7-923B-000000000000),
version(1.0),
helpstring("SAWZipNG 1.0 Type Library"),
custom(DE77BA64-517C-11D1-A2DA-0000F8773CE9, 83951780),
custom(DE77BA63-517C-11D1-A2DA-0000F8773CE9, 1053810739)

]
library SAWZipNG
{
// TLib : // TLib : OLE Automation : {00020430-0000-0000-C000-000000000046}
importlib("stdole2.tlb");

// Forward declare all types defined in this typelib
dispinterface _IArchiveEvents;
interface IFileInfo;
interface IArchive;

[
uuid(D4C11DB1-8B64-11D7-923B-000000000000),
helpstring("_IArchiveEvents Interface")
]
dispinterface _IArchiveEvents {
properties:
methods:
[id(0x00000001), helpstring("Fired when a file is added to the archive")]
HRESULT OnAdd(
[in] BSTR filename,
[in] long soFar,
[in] long ToDo);
[id(0x00000002), helpstring("Fired when a file is extracted")]
HRESULT OnExtract(
[in] BSTR filename,
[in] long soFar,
[in] long ToDo);
[id(0x00000003), helpstring("Fired when a file is deleted")]
HRESULT OnDelete(
[in] BSTR filename,
[in] long soFar,
[in] long ToDo);
[id(0x00000004), helpstring("Fired when a file is stored")]
HRESULT OnStore(
[in] BSTR filename,
[in] long soFar,
[in] long ToDo);
[id(0x00000005), helpstring("method OnDiskNeeded")]
HRESULT OnDiskNeeded(
[in] long disk,
[in, out] VARIANT_BOOL* Cancel);
};

[
odl,
uuid(D4C11DB4-8B64-11D7-923B-000000000000),
helpstring("IFileInfo Interface"),
dual,
oleautomation
]
interface IFileInfo : IDispatch {
[id(0x00000001), propget, helpstring("Filename")]
HRESULT filename([out, retval] BSTR* pVal);
[id(0x00000001), propput, helpstring("Filename")]
HRESULT filename([in] BSTR pVal);
[id(0x00000002), propget, helpstring("Comment")]
HRESULT Comment([out, retval] BSTR* pVal);
[id(0x00000002), propput, helpstring("Comment")]
HRESULT Comment([in] BSTR pVal);
[id(0x00000003), propget, helpstring("Compression ratio of the file")]
HRESULT CompressionRatio([out, retval] single* pVal);
[id(0x00000004), propget, helpstring("Size of the file after compression")]
HRESULT CompressionSize([out, retval] long* pVal);
[id(0x00000005), propget, helpstring("File Attributes")]
HRESULT Attributes([out, retval] long* pVal);
[id(0x00000006), propget, helpstring("Is this file encrypted or not?")]
HRESULT Encrypted([out, retval] VARIANT_BOOL* pVal);
[id(0x00000007), propget, helpstring("UncompressedSize")]
HRESULT UncompressedSize([out, retval] long* pVal);
[id(0x00000008), propget, helpstring("Modification date")]
HRESULT ModificationDate([out, retval] DATE* pVal);
[id(0x00000008), propput, helpstring("Modification date")]
HRESULT ModificationDate([in] DATE pVal);
};

[
uuid(D4C11DB0-8B64-11D7-923B-000000000000),
helpstring("Archive Class")
]
Reply With Quote
  #4 (permalink)  
Old 10-17-2005, 02:02 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Read from inside Zip or Rar file

coclass Archive {
[default] interface IArchive;
[default, source] dispinterface _IArchiveEvents;
};

[
odl,
uuid(D4C11DAF-8B64-11D7-923B-000000000000),
helpstring("IArchive Interface"),
dual,
oleautomation
]
interface IArchive : IDispatch {
[id(0x00000001), helpstring("open an archive file")]
HRESULT Open(
[in] BSTR filename,
[in, optional, defaultvalue(0)] OpenMode OpenMode,
[in, optional, defaultvalue(0)] int volumeSize);
[id(0x00000002), propget, helpstring("Is this archive readonly?")]
HRESULT ReadOnly([out, retval] VARIANT_BOOL* pVal);
[id(0x00000003), propget, helpstring("Number of files in the archive")]
HRESULT FileCount([out, retval] long* pVal);
[id(0x00000004), propget, helpstring("Number of directories in the archive")]
HRESULT DirCount([out, retval] long* pVal);
[id(0x00000005), propget, helpstring("Number of files and directories in the archive")]
HRESULT Count([out, retval] long* pVal);
[id(0x00000006), helpstring("Close the archive")]
HRESULT Close();
[id(0x00000007), propget, helpstring("Is this archive opened or closed?")]
HRESULT Closed([out, retval] VARIANT_BOOL* pVal);
[id(0x00000008), helpstring("Gets a FileInfo object")]
HRESULT GetFileInfo(
[in] long index,
[out, retval] IFileInfo** fi);
[id(0x00000009), helpstring("Create a new archive")]
HRESULT Create(
[in] BSTR filename,
[in, optional, defaultvalue(0)] CreateMode CreateMode,
[in, optional, defaultvalue(0)] int volumeSize);
[id(0x0000000a), propget, helpstring("Root path")]
HRESULT RootPath([out, retval] BSTR* pVal);
[id(0x0000000a), propput, helpstring("Root path")]
HRESULT RootPath([in] BSTR pVal);
[id(0x0000000b), helpstring("Adds a file to the archive")]
HRESULT AddFile(
[in] BSTR filename,
[in, optional, defaultvalue(-1)] VARIANT_BOOL fullpath,
[in, optional, defaultvalue(-1)] short level,
[in, optional, defaultvalue(7)] Smartness smartLevel,
[in, optional, defaultvalue(65536)] long bufferSize,
[out, retval] VARIANT_BOOL* result);
[id(0x0000000c), helpstring("Adds a file to the archive with another name")]
HRESULT AddFileAs(
[in] BSTR filename,
[in] BSTR nameInZip,
[in, optional, defaultvalue(-1)] short level,
[in, optional, defaultvalue(7)] Smartness smartLevel,
[in, optional, defaultvalue(65536)] long bufferSize,
[out, retval] VARIANT_BOOL* result);
[id(0x0000000d), helpstring("Extracts a file from the archive")]
HRESULT Extract(
[in] long index,
[in] BSTR path,
[in, optional, defaultvalue(-1)] VARIANT_BOOL fullpath,
[in, optional, defaultvalue(65536)] long bufferSize,
[out, retval] VARIANT_BOOL* result);
[id(0x0000000e), helpstring("method ExtractAs")]
HRESULT ExtractAs(
[in] long index,
[in] BSTR path,
[in] BSTR newName,
[in, optional, defaultvalue(-1)] VARIANT_BOOL fullpath,
[in, optional, defaultvalue(65536)] long bufferSize,
[out, retval] VARIANT_BOOL* result);
[id(0x0000000f), propget, helpstring("Password for the file that will be extracted or added")]
HRESULT Password([out, retval] BSTR* pVal);
[id(0x0000000f), propput, helpstring("Password for the file that will be extracted or added")]
HRESULT Password([in] BSTR pVal);
Reply With Quote
  #5 (permalink)  
Old 10-17-2005, 02:03 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Read from inside Zip or Rar file

[id(0x00000010), helpstring("method PredictExtractedFileName")]
HRESULT PredictExtractedFileName(
[in] BSTR FileNameInZip,
[in] BSTR path,
[in] VARIANT_BOOL fullpath,
[in] BSTR newName,
[out, retval] BSTR* result);
[id(0x00000011), helpstring("method TestFile")]
HRESULT TestFile(
[in] long index,
[in, optional, defaultvalue(65536)] long bufferSize,
[out, retval] VARIANT_BOOL* result);
[id(0x00000012), propget, helpstring("property WriteBufferSize")]
HRESULT WriteBufferSize([out, retval] long* pVal);
[id(0x00000012), propput, helpstring("property WriteBufferSize")]
HRESULT WriteBufferSize([in] long pVal);
[id(0x00000013), propget, helpstring("property GeneralBufferSize")]
HRESULT GeneralBufferSize([out, retval] long* pVal);
[id(0x00000013), propput, helpstring("property GeneralBufferSize")]
HRESULT GeneralBufferSize([in] long pVal);
[id(0x00000014), propget, helpstring("property SearchBufferSize")]
HRESULT SearchBufferSize([out, retval] long* pVal);
[id(0x00000014), propput, helpstring("property SearchBufferSize")]
HRESULT SearchBufferSize([in] long pVal);
[id(0x00000015), propget, helpstring("property Comment")]
HRESULT Comment([out, retval] BSTR* pVal);
[id(0x0000001e), helpstring("method FindFile")]
HRESULT FindFile(
[in] BSTR filename,
[in, optional, defaultvalue(0)] FFCaseSensitivity caseSensitive,
[in, optional, defaultvalue(0)] VARIANT_BOOL filenameOnly,
[out, retval] long* index);
[id(0x00000015), propput, helpstring("property Comment")]
HRESULT Comment([in] BSTR pVal);
[id(0x00000016), propget, helpstring("property AutoFlush")]
HRESULT AutoFlush([out, retval] VARIANT_BOOL* pVal);
[id(0x00000016), propput, helpstring("property AutoFlush")]
HRESULT AutoFlush([in] VARIANT_BOOL pVal);
[id(0x00000017), helpstring("method Flush")]
HRESULT Flush();
[id(0x00000018), helpstring("method AddFolder")]
HRESULT AddFolder(
[in] BSTR foldername,
[in, optional, defaultvalue(-1)] VARIANT_BOOL includeSubDirs,
[in, optional, defaultvalue(-1)] VARIANT_BOOL fullpath,
[in, optional, defaultvalue(-1)] short level,
[in, optional, defaultvalue(7)] Smartness smartLevel,
[in, optional, defaultvalue(65536)] long bufferSize,
[out, retval] VARIANT_BOOL* result);
[id(0x00000019), helpstring("method AddFolderWithWildcard")]
HRESULT AddFolderWithWildcard(
[in] BSTR foldername,
[in] BSTR wildcard,
[in, optional, defaultvalue(-1)] VARIANT_BOOL includeSubDirs,
[in, optional, defaultvalue(-1)] VARIANT_BOOL fullpath,
[in, optional, defaultvalue(-1)] short level,
[in, optional, defaultvalue(7)] Smartness smartLevel,
[in, optional, defaultvalue(65536)] long bufferSize,
[out, retval] VARIANT_BOOL* result);
[id(0x0000001a), helpstring("method DeleteFile")]
HRESULT DeleteFile([in] long index);
[id(0x0000001b), helpstring("method DeleteFiles")]
HRESULT DeleteFiles([in] VARIANT indexes);
[id(0x0000001c), helpstring("method FindFiles")]
HRESULT FindFiles(
[in] BSTR Pattern,
[in, optional, defaultvalue(-1)] VARIANT_BOOL fullpath,
[out, retval] VARIANT* indexes);
[id(0x0000001d), propget, helpstring("property IgnoreCrc")]
HRESULT IgnoreCrc([out, retval] VARIANT_BOOL* pVal);
[id(0x0000001d), propput, helpstring("property IgnoreCrc")]
HRESULT IgnoreCrc([in] VARIANT_BOOL pVal);
[id(0x0000001f), helpstring("method GetIndexes")]
HRESULT GetIndexes(
[in] VARIANT filenames,
[out, retval] VARIANT* indexes);
[id(0x00000020), propget, helpstring("property ArchivePath")]
HRESULT ArchivePath([out, retval] BSTR* pVal);
[id(0x00000021), helpstring("method SetFileComment")]
HRESULT SetFileComment(
[in] long index,
[in] BSTR Comment);
[id(0x00000022), propget, helpstring("property SystemCompatibility")]
HRESULT SystemCompatibility([out, retval] Platform* pVal);
[id(0x00000022), propput, helpstring("property SystemCompatibility")]
HRESULT SystemCompatibility([in] Platform pVal);
[id(0x00000023), propget, helpstring("property TempPath")]
HRESULT TempPath([out, retval] BSTR* pVal);
[id(0x00000023), propput, helpstring("property TempPath")]
HRESULT TempPath([in] BSTR pVal);
[id(0x00000024), helpstring("method PredictFileNameInZip")]
HRESULT PredictFileNameInZip(
[in] BSTR filename,
[in, optional, defaultvalue(-1)] VARIANT_BOOL fullpath,
[in, optional, defaultvalue(0)] VARIANT_BOOL Exact,
[out, retval] BSTR* FileNameInZip);
[id(0x00000025), helpstring("method WillBeDuplicated")]
HRESULT WillBeDuplicated(
[in] BSTR FilePath,
[in, optional, defaultvalue(-1)] VARIANT_BOOL fullpath,
[in, optional, defaultvalue(0)] VARIANT_BOOL filenameOnly,
[out, retval] long* index);
[id(0x00000026), propget, helpstring("property CurrentDisk")]
HRESULT CurrentDisk([out, retval] short* pVal);
[id(0x00000027), propget, helpstring("property SpanMode")]
HRESULT SpanMode([out, retval] SpanMode* pVal);
[id(0x00000028), propget, helpstring("property EnableFindFast")]
HRESULT EnableFindFast([out, retval] VARIANT_BOOL* pVal);
[id(0x00000028), propput, helpstring("property EnableFindFast")]
HRESULT EnableFindFast([in] VARIANT_BOOL pVal);
[id(0x00000029), helpstring("method RenameFile")]
HRESULT RenameFile(
[in] long index,
[in] BSTR newFilename,
[out, retval] VARIANT_BOOL* result);
[id(0x0000002a), propget, helpstring("property CaseSensitivity")]
HRESULT CaseSensitivity([out, retval] VARIANT_BOOL* pVal);
[id(0x0000002a), propput, helpstring("property CaseSensitivity")]
HRESULT CaseSensitivity([in] VARIANT_BOOL pVal);
};

Reply With Quote
  #6 (permalink)  
Old 10-17-2005, 02:04 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Read from inside Zip or Rar file

typedef enum {
OM_OPEN = 0,
OM_READONLY = 1
} OpenMode;

typedef enum {
CM_CREATE = 0,
CM_CREATE_SPAN = 1
} CreateMode;

typedef enum {
SM_LAZY = 0,
SM_CPASSDIR = 1,
SM_CPFILE = 2,
SM_NOT_COMP_SMALL = 4,
SM_CHECK_FOR_EFF = 8,
SM_MEMORY_FLAG = 16,
SM_CHECK_FOR_EFF_IN_MEM = 24,
SM_SMART_PASS = 3,
SM_SMART_ADD = 12,
SM_SMART_SAFE = 7,
SM_SMART_TEST = 15
} Smartness;

typedef enum {
FF_DEFAULT = 0,
FF_SENSITIVE = 1,
FF_NON_SENSITIVE = 2
} FFCaseSensitivity;

typedef enum {
ZP_DOS_FAT = 0,
ZP_AMIGA = 1,
ZP_VAX_VMS = 2,
ZP_UNIX = 3,
ZP_VM_CMS = 4,
ZP_ATARI = 5,
ZP_OS2_HPFS = 6,
ZP_MAC = 7,
ZP_Z_SYSTEM = 8,
ZP_CP_M = 9,
ZP_NTFS = 10
} Platform;

typedef enum {
SPM_EXIST_TD = 0xfffffffe,
SPM_EXIST_PKZIP = 0xffffffff,
SPM_NO = 0,
SPM_CREATE_PKZIP = 1,
SPM_CREATE_TD = 2
} SpanMode;

[
uuid(D4C11DB5-8B64-11D7-923B-000000000000),
helpstring("FileInfo Class")
]
coclass FileInfo {
[default] interface IFileInfo;
};
};
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 02:00 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.