"Container" document attachments are unpacked

(Clay Heaton) #1

I just set up an internal Discourse instance to support feedback related to some ongoing projects. On one of the projects, we use the OS X app OmniGraffle to do wireframing and write specifications. OmniGraffle “files,” ending with the extension .graffle actually are containers, like many files are on OS X. I think Pages files are this way, too, for example. The .graffle documents contain a data.plist file and whatever images you’ve embedded into the document.

Here’s how it looks in the finder. Double-clicking opens OmniGraffle and the “document.”

If you right-click on it, you can “Show Package Contents” to browse the container/folder. Inside you’ll see the following:

Anyhow - in my Discourse instance, I allowed .graffle as an extension for file attachments, thinking it would be a good way to share these documents, from time to time.

Discourse viewed the requirements.graffle file as a folder, and instead of uploading the “file” as a single entity, it uploaded all of the contents of the .graffle package – all 19 files separately.

While it’s cool to be able to upload a folder full of files, in this instance (and with other OS X documents that use a package structure), the ‘file’ should be uploaded as a single entity.

(Jens Maier) #2

Did you verify this behaviour with different web browsers? This sounds a lot like a feature of (I presume) Safari got in your way…

(Clay Heaton) #3

Good call – I didn’t test with multiple browsers.

The problem happens with Chrome.

Firefox doesn’t allow the .graffle file to be attached at all.

Safari uploads it as a single file.

I guess there’s nothing Discourse can do about this, then, since it’s a Chrome “feature?”

(Jeff Atwood) #4

… and specific to Macs as well. So specific to Chrome, and Macs.

(Tudor Vedeanu) #5

Those package “files” are only treated as regular files by OS X. Safari is clever and it zips them automatically before uploading. The rest of the operating systems and other browsers treat them like folders, which is what they actually are.