You can map the .json extension to one of the supported MIME types like "text/js" or "text/plain":
If you have uploaded .json files to the media archive before you do the change described above, these files have the MIME type of "application/octet-stream" (by default):
For these files, you can. for example:
- Edit web.config
- Add the mapping below configuration/system.webServer/staticContent
-
Save web.config
<configuration>
<!-- ... -->
<system.webServer>
<!-- ... -->
<staticContent>
<!-- ... -->
<mimeMap fileExtension=".json" mimeType="text/plain" />
</staticContent>
<!-- ... -->
</system.webServer>
<!-- ... -->
</configuration>
One more thing.If you have uploaded .json files to the media archive before you do the change described above, these files have the MIME type of "application/octet-stream" (by default):
<MediaFileDataElements Id="01c27ae7-5894-45ae-ad88-06c44bb0aa09" FolderPath="/" FileName="sample.json" Title="" Description="" CultureInfo="en-US" MimeType="application/octet-stream" Length="603" CreationTime="2016-03-04T10:08:02.8341896+02:00" LastWriteTime="2016-03-04T10:08:02.8341896+02:00" />
So these files will still be non-editable.For these files, you can. for example:
- either replace the MimeType of these files to "text/plain" (or whichever you've chosen) manually in ~/App_Data/Composite/DataStores/Composite.Data.Types.IMediaFileData.xml (or an equivalent SQL table)
-
or upload them again overwriting the existing ones ("Media" > "Download", then "Upload File" with the "Replace existing file" option enabled)