Problem with downloading .audulus files on iOS

(Mark Boyd) #1

We’re sharing our .audulus files on our forum, but they’re not opening correctly when downloaded from iOS.

On computer it works fine.

On iOS, what happens is it gets turned into a .txt file and displayed in the browser.

Long pressing and “Open In” doesn’t work.

Have tried to fix it myself but can’t figure out what settings might need to be changed.

Any hints? I can provide a copy of Audulus for staff if it’s necessary to check that it’s working.

Example patch to download:

Patch to download on iOS

What it looks like when you try to open

On old Vanilla forum, “Open in Audulus” was an option here

(Felix Freiberger) #2

My best guess is that this most likely is a problem with the MIME type, so I’d try to investigate which MIME types Discourse and Vanilla send.

(Simon Cossar) #3

I have Audulus on my iPad, so I’ve looked at this a bit. Audulus files can be downloaded on an iPad by quick pressing the download link. This opens the file and displays it on the screen. The file can then be saved and opened in Audulus. The other thing that works is to long press the link and then select Open, or Open in New Tab, from the options menu. Doing this displays the file on the screen in the same way as when the link is quick pressed. It can then be saved and later opened in Audulus. I’m saving the files to Dropbox. When the file is saved, the .audulus file extension is preserved. I’ve tested this with links from here:

I haven’t found any way to open a file directly in Audulus without first saving it.

(Mark Boyd) #4

So yeah we know there are workarounds, but they all require extra steps that you didn’t have to do on our old Vanilla forum.

On the old forum, you’d click on the file and it would either ask you where you wanted to open it (and Audulus would be an option) or it would just automatically open in it.

This really has to be how it works long term for us. The current solution isn’t workable. People should just be able to open the file after tapping on it, and not need a separate tutorial on how to open the files.

If we had known this was how Discourse works with our files, we would not have transitioned over to it fully until it was solved. That was my bad I guess - I figured it would just work just like everything else is working well.

I feel like the answer you’re giving me is you saying that you’re ready to stop working on this and that how it is right now is OK - I’m telling you though it’s not okay, and the solution you’re suggesting is something that people had already found as a workaround before you started working on this.

We have to make downloading our patches as fool-proof as possible. If it isn’t, we lose forum participation, and people might think “eh, is this patch worth the extra few steps I need to take to get it to work?”

We don’t want people fighting against our forum.

(Simon Cossar) #5

No, I’m just telling you where it’s at now. I’d like to understand what conditions are required for iOS to give the option to open a file with a specific application and what it is that Discourse is doing to prevent that from happening.

(Mark Boyd) #6

Awesome - sounds like it was just a little miscommunication then. What do you need from us to make it happen?

(Régis Hanol) #7

Do you have an example of a working URL we can try? That’d be helpful.

(Mark Boyd) #8

So first go to - it does not have an SSL certificate at the moment and it will look blank on mobile. Go to “Request Desktop Site” at bottom.

Sign in here (will PM you login credentials).

Click on this top topic.

Find one of these files at the bottom of the posts and tap on it.

The screen you should see (and we hope to see on Discourse) looks like this below. The link to the file directly is:

You have to be signed in to download the files though.

(Régis Hanol) #11

Ok, so here are the differences in the response headers


Content-Transfer-Encoding: binary
Content-Type: application/force-download


Content-Disposition: attachment; filename="Grok Electribe ER1 V2.0 - Lord Gogo.audulus"
Content-Type: application/octet-stream

So you were forcing the user to download the file and open it using the default application while Discourse is asking the user what to do with the file.

(Mark Boyd) #13

Thanks! So how can we make this happen on our site now? Is it something we can do, or do you have to do it on the backend?

(Jeff Atwood) #14

I’m deeply uncomfortable with a default in Discourse that forces users to download a file. That could be widely abused and lead to Discourse being blacklisted or scrubbed by virus detection software.

(Stephen Schoen) #15

I was looking at some test files today using macOS Firefox and what I see in the response header for .audulus files is text/html; charset=utf-8. I followed the same process for a zipped version and got application/zip. I believe that Discouse is setting the MIME type to text/html incorrectly rather than application/octet-stream or perhaps application/json (.audulus files are JSON files)

(Jeff Atwood) #16

That’s not what @zogstrip reported:

Content-Disposition: attachment; filename="Grok Electribe ER1 V2.0 - Lord Gogo.audulus"
Content-Type: application/octet-stream

(Stephen Schoen) #17

I rechecked by pasting a copy of the link into the address bar and is does look like it’s set to application/octet-stream. Earlier I was looking at the header returned from simply clicking on the file download link which was actually for the service worker. Sorry

(Mark Boyd) #18

So are you saying there’s nothing we can do to get an “open in Audulus” working?

(Jeff Atwood) #19

It will require a few months of feature work to make it configurable.

(Stephen Schoen) #21

One of the issues with the current process is that as far as I can tell, it is not possible to download and save a .audulus file without using either an external server like drop box or a third party app. If you short press the file and display the contents, it is possible to highlight the file contents and save them, but I could find no way to remove the .txt extension from within iOS. If I save the file to iCloud I can use myMac to remove the file extension, but that doesn’t seem to be an option with iOS. I don’t believe that Discourse is the root cause of the problem since it would appear that it is sending an appropriate MIME type, but until iOS 11 there was no user access to the iOS file system, so Safari was very restrictive regarding file downloads. I haven’t found any definitive info in the Apple developer docs, but I’ll keep looking

(Mark Boyd) #22

Thanks - just looking for a clarification though: does this mean you’re working on it and we can check back in about this in a few months, or you’re just stating it would take a few months to do this, but you’re not necessarily starting on it right now?

(Jeff Atwood) #23

We’ll work on it over the next few months. In the meantime I suggest finding some practical workarounds.

(Stephen Schoen) #24

FYI application/force-download does not appear to be a registered MIME type per IANA: Media Types.
I was experimenting yesterday with possible work-arounds and discovered that if I used a file named that I would get the “open in Audulus 3” prompt. Of course the file wouldn’t actually open, but Safari apparently attempted to hand the file off based on the extension. It did result in registering Audulus as the application for opening ZIP files on my iPad, but that’s another issue. I’m guessing that the reason our old Forum is working is not because of the application/force-download MIME type specifically, since it seems very unlikely that Apple would have coded any specific support for an unregistered type, but rather that Safari didn’t recognize the MIME type and used the file extension instead. Perhaps the application/octet-stream gets some special handling in Safari for iOS. Apple’s documentation for Safari has not be updated in some time and makes no mention of file downloads outside the limited MIME types supported previously.