Saving downloaded zip file: cpgz file type
Keith Clarke
keith.clarke at clarkeandclarke.co.uk
Mon Jun 6 14:14:54 EDT 2011
Sorted - I dropped the string into TextWrangler and saved it with the same result, so it wasn't revXML failing to handle binary data.
A deeper dig into the web service documentation found that zip file string is base64encoded.
So, a quick decode before the save to URL binfile:... and all is well.
Best,
Keith..
On 6 Jun 2011, at 18:44, Keith Clarke wrote:
> Thanks for the response Mark, the tip on binfile and the possible limitations of revXML.
> This particular XML file isn't too complex. So, although I have the STSXML libary available, I'll first try extracting the zip file node string as a text chunk.
> Best,
> Keith..
>
> On 6 Jun 2011, at 16:22, Mark Schonewille wrote:
>
>> Hi Keith,
>>
>> Your zip file is corrupt. First of all, replace "file:" with "binfile:".
>>
>> It is possible that the revXML external can't cope with binary data. In that case, your zip file will stay corrupt and you'll have to retrieve the data manually.
>>
>> --
>> Best regards,
>>
>> Mark Schonewille
>>
>> Economy-x-Talk Consulting and Software Engineering
>> Homepage: http://economy-x-talk.com
>> Twitter: http://twitter.com/xtalkprogrammer
>> KvK: 50277553
>>
>> New: Download the Installer Maker Plugin 1.6 for LiveCode here http://qery.us/ce
>>
>> On 6 jun 2011, at 17:03, Keith Clarke wrote:
>>
>>> Hi folks,
>>> I'm downloading a zip file via a web service call - the file is embedded as a long string within the ...<result><zipFile> node of the XML file, accompanied by a set of nodes that name the (xml text) files that I should find within the zipped payload.
>>>
>>> So, I save this string out to to disk with...
>>>
>>> put revXMLNodeContents(tTree, tResultNode & "/zipFile/") into URL "file:package.zip"
>>>
>>> This creates a zip file on disk OK, but when when I open the archive, instead of a list of files, I get a .cpgz file - and attempting to open this causes some weird recursion. (I get the same result if I use the URL 'binfile' prefix.)
>>>
>>> What am I doing wrong here - am I using the correct syntax or failing to encode/decode for the zip file definition string?
>>> Best,
>>> Keith..
>
More information about the use-livecode
mailing list