|

how to host restricted filetypes on neocities without a supporter account

you may know of neocities' filetype limitations for non-supporters. turns out that you actually CAN embed files of whatever type you want. wanna know how? well start reading the next paragraph lol

i did this by converting the media to base64, a method of storing binary data in text characters (you can do this by using a converter like this online one.) a method of storing binary data as text, then specifying that the data is of a certain filetype. to see how the Base64 and syntax is formatted, you can open the element inspector in your (desktop's) browser by hitting the F12 key. navigate over to one of the first 2 below elements and there's the good 'ol Base64.

video source

this also works for some other file types. here's a zip file as an example.

alternatively, you can put the base64-encoded file in a seperate file and insert it using an embed or iframe tag.

this method's a bit less annoying to deal with as the data is on a seperate file but it may cause the page to load slower as well as potentially causing performance issues due to the video being within what is basically a whole new tab, thus increasing memory usage.

keep in mind that encoding in base64 results in a 1/3 increase in file size. and that some browsers have strict (and quite low) file size limits for embeds. see the second link in further reading to read up on that. non-major browsers that aren't based on chromium or firefox may not support Base64.

further reading

  1. MDN Doc covering Base64
  2. Common issues encountered while trying to use Base64