How to find the mime type of a file in python?

Let's say you want to save a bunch of files somewhere, for instance in BLOBs. Let's say you want to dish these files out via a web page and have the client automatically open the correct...

Play MP3 file stored as blob

Put simply, I'd like to play a blob MP3 file in Firefox. I have access to both the blob itself: blob (sliced with mime type audio/mpeg3), and its URL: blobURL = window.URL.createObjectURL(blob). I...

using xmlhttprequest to fetch a cross-domain PNG file

Sadly, I see a zillion similar questions but no answers that seem specific to my situation. I am not using jquery. I don't care about anything but the newest browsers (Chrome in particular). I...

PHP display image BLOB from MySQL

I'm attempting to display an image stored in the BLOB column in the database; I fetch the data from the database with a SELECT perform no transformations on the data and display it with the...

PHP: iPad does not play MP4 videos delivered by PHP, but if accessed directly it does

I am trying to find a solution for this problem for some days already, I tried all advices I could find here on stackoverflow and other platforms. And still, there is no solution. I am embedding a...

Google forms \ script to return multiple attachments

I am trying to set up automatic email response with attachments for when a user completes a google form. One of the attachments is a zip file and the other .dmg file.From reading similar questions...

sendBeacon API not working temporarily due to security issue, any workaround?

I have the following code to send asynchronous HTTP request using sendBeacon method, var data = { name: 'test', uniqueId: Math.random() }; var blob = new Blob([JSON.stringify(data)], {type :...

How to serve a CSS file from Google Apps Script

Is it possible to serve a CSS file from Apps Script to a web page via @import and, if so, how? Here is what I have in my Apps Script project: function doGet() { return...

Service Worker registration error: Unsupported MIME type ('text/html')

I'm using create-react-app with an express server. create-react-app has a pre-configured ServiceWorker that caches local assets...

Azure File storage content-type is always application/octet-stream

I'm currently having issue with Azure File storage when I build up a URL with a shared access signature (SAS) Token. The file will download in the browser, but the content-type is always...

Angular [Innerhtml] renders static files different from webapi response

Need to display HTML file content in a DIV, works in static file, fails on dynamic file. What Works: I have an EML file, which I suspected I had to parse. Renaming file extension to HTML, as is...

How to parse and play Blob/Binary data from database in Angular 5

In my Angular 5 application, I am retrieving data which is stored as VARBINARY(MAX) in SQL Server database. It looks like this in the database field: 0xFEA47E451A40AE4571E51F... When I retrieve it...

How to enable LHLS in FFMPEG 4.1?

I am trying to create a low latency CMAF video stream using FFMPEG. To do so, I would like to enable the lhls option in FFMPEG in order to have the #EXT-X-PREFETCH tag written in the HLS...

Convert mediarecorder blobs to a type that google speech to text can transcribe

I am making an app where the user browser records the user speaking and sends it to the server which then passes it on to the Google speech to the text interface. I am using mediaRecorder to get...

Cannot get audio blob recorded in chrome to work in safari

I am attempting to play a play an audio blob within safari and it plays for a fraction of a second and I never hear any audio. The media element fires a "paused" event a tiny fraction of a second...

serve .ics file to webcal:// instead of download by browser

I have some code that is using ics.js framework which uses fileSaver.js (https://github.com/eligrey/FileSaver.js) to create and save a calendar invite (.ics) into the users browser. Through...

Rails: Permanent url for active storage videos

I'm building a webapp which is offline available. Therefore I need urls to images and videos were not expiring at any time. ActiveStorage is not build for that case. So I build my own media...

Set ContentType on Azure Blob on upload from Javascript using UploadBrowserDataToBlockBlob

For PDF files to display in the browser - instead of downloading - you need to supply them with the application/pdf content type header. By default, Azure Blob Storage files are set to...

Unable to open `docx` files client-side using a Blob object - vanilla JavaScript

This is the code client-side, it's a minimum, complete and verifiable snippet that will allow fellow developers to test this by themselves. // requires: a string that contains html tags //...

Webm File Not Playing

I create a mediaRecorder to record video/audio and attach the recorded data, as an attribute, onto the canvas, like this: var options = { mimeType: 'video/webm;codecs=H264' }; try...

How to convert Audio buffer to MP3 in Javascript?

I am using MediaRecorder in ReactJS to record audio from the microphone and storing into the blob with MIME type "audio/mp3". I want to convert this blob to MP3 and upload it in S3 bucket. I am...

Why does RecordRTC always set my mime type to x-matroska

Im trying to record a video from my webcam with the node package 'recordrtc' (im using angular). Even though i set the mime type in the options to 'video/webm' it always seems to switch it back to...

How do you figure out gstreamer profile strings

Trying to use encodebin and its profiles. The documentations here:...

Mediarecorder: How to support audio recording on Safari, IE 11?

Problem Statement Hi, I want to add support for audio recording using MediaRecorder API in my app for IE 11 and Safari, but couldn’t figure anything so far. Are there any polyfills available...

createObjectURL overload resolution failed

I am trying to load a PDF as a blob in JavaScript from the backend, but receive Failed to execute 'createObjectURL' on 'URL': Overload resolution failed. I'm not really sure where to go from here....

Corrupt video uploads when chunking MediaRecorder to Google Cloud platform

I currently am using react hook powered component to record my screen, and subsequently upload it to Google Cloud Storage. However, when it finishes, the file created inside Google Cloud appears...

How to open "Save as" dialog to save a ppt file in react?

I have a button and on a click of it, I'm calling "get" REST-API call where I get a base64 string. I'm converting it to blob data and generating ppt out of it by calling it's MIME type. Issue...

JSON.stringify an object with a blob

I have an object with an audio blob inside of it. When I call JSON.stringify on the object, the blob disappears. How to stringify a binary blob in an object ? The audio blob is from the...

Axios in React Native - Cannot POST a Blob or File

I'm trying to post the raw data of a picture, using Axios, after taking it with react-native-image-picker. I successfully generated a blob using this piece of code: const file = await...

46: regex error 17 for `(dryad-bibo/v)[0-9].[0-9]', (match failed)

I'm trying to determine the mime-type for several types of files using libmagic and the following bit of code: auto handle = ::magic_open(MAGIC_MIME_TYPE); ::magic_load(handle, NULL); // Both of...