What is JotForm?JotForm is a free which helps you create online forms without writing a single line of code. Try Out JotForm!At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.We believe that if one user has a question, there could be more users who may have the same question.
This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern. We are sorry for the inconveniences.However, as far as I understand, we intentionally use the 'application/octet-stream' content-type to tell that this is a binary file and it should be downloaded to the disk. One of the reasons is that we do not want to be used as a web host for files (which may generate huge traffic and affect other users). We use the same content-type for downloads of the other file types too.We can forward a ticket to our developers regarding the issue, but I do not think that this behavior will be changed anytime soon.
The header that triggers download to disk is Content-Disposition, which you set correctly to 'attachment'.The Content-Type header specifies the nature of the file. If you set it incorrectly, you can expect browsers (especially on mobile devices) to not know what to do with the file.
As a result, after download users will get a message saying they do not know with what app to open the file.Mangling the Content-Type is in essence a data loss issue: you were given the correct information by the browser that uploaded the file, but you do not return this information when retrieving the file. As such it should really be fixed.Thanks in advance!
Open Application Octet Stream File
You are not allowed to upload application/octet-stream files(1)No.The content-type should be whatever it is known to be, if you know it. Application/octet-stream is defined as 'arbitrary binary data' in RFC 2046, and there's a definite overlap here of it being appropriate for entities whose sole intended purpose is to be saved to disk, and from that point on be outside of anything 'webby'. Or to look at it from another direction; the only thing one can safely do with application/octet-stream is to save it to file and hope someone else knows what it's for.You can combine the use of Content-Disposition with other content-types, such as image/png or even text/html to indicate you want saving rather than display.
It used to be the case that some browsers would ignore it in the case of text/html but I think this was some long time ago at this point (and I'm going to bed soon so I'm not going to start testing a whole bunch of browsers right now; maybe later).RFC 2616 also mentions the possibility of extension tokens, and these days most browsers recognise inline to mean you do want the entity displayed if possible (that is, if it's a type the browser knows how to display, otherwise it's got no choice in the matter). This is of course the default behaviour anyway, but it means that you can include the filename part of the header, which browsers will use (perhaps with some adjustment so file-extensions match local system norms for the content-type in question, perhaps not) as the suggestion if the user tries to save.Hence: Content-Type: application/octet-streamContent-Disposition: attachment; filename='picture.png'Means 'I don't know what the hell this is. Please save it as a file, preferably named picture.png'. Content-Type: image/pngContent-Disposition: attachment; filename='picture.png'Means 'This is a PNG image. Please save it as a file, preferably named picture.png'. Content-Type: image/pngContent-Disposition: inline; filename='picture.png'Means 'This is a PNG image.
Please display it unless you don't know how to display PNG images. Otherwise, or if the user chooses to save it, we recommend the name picture.png for the file you save it as'.Of those browsers that recognise inline some would always use it, while others would use it if the user had selected 'save link as' but not if they'd selected 'save' while viewing (or at least IE used to be like that, it may have changed some years ago). The says:If this header Content-Disposition: attachment is used in a responsewith the application/octet-stream content-type, the impliedsuggestion is that the user agent should not display the response, butdirectly enter a `save response as.' Dialog.I read that as Content-Type: application/octet-streamContent-Disposition: attachmentBut I would have thought that Content-Type would be application/pdf, image/png, etc.Should I have Content-Type: application/octet-stream if I want browsers to download the file?