General information
Category:
Coding, syntax & commands
thanks dragan for showing how complicated life can really be if you tried hard enough.
k
>>I am saving email attachment in directory called attachments.
>>I then do a count to determine if the file is a .doc or a .docx
>>
>>the count i am using does not seem to distinguish between the two. I have ONE file in attachments which is a .docx
>>instead i am getting 1 count for doc AND i count for docx.
>
>BTW, since .docx is actually a zipped folder with a bunch of xml files inside (and subfolders with more of the same), you can physically distinguish the two by opening each file low-level, reading the first two bytes, and checking if these two are "PK" (signature of Phil Katz, who wrote the original PKZip).
>
>I had to do so in one case, where some .doc files were actually docx files, saved under the old extension.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only