in reply to Trouble downloading .KMZ files with www-mechanize

Welcome cbouwkamp,

Please have a read the following as your question is lacking detail (and appears to be lacking effort which we despise ) :
How do I compose an effective node title?
How do I post a question effectively?

How do you know the file is corrupted?
If the file is plain text, what does it look like if viewed in notepad?
Do you have a file that works correctly?
- If so, what is different between it and the corrupted file when you compare them?
Does the file need to be saved in some flavour of Unicode?

Update: I am wondering if this is an okay way to obtain those types of files or not
As far as I'm aware that should be fine...

Since the files are not plain text, get hold of a good file comparison tool. I quite like winmerge but there are plenty of others. Use it to compare the same file, 1 that was retrieved using your script and the other using your browser. It should highlight exactly what is different between the two files.

Update2:
Have you tried using this $mech->get( $url, ':content_file' => $filename ); to retrieve the file? www::Mech examples