Blob download is not working in IE

Try this using, this or useragent if (navigator.appVersion.toString().indexOf(‘.NET’) > 0) window.navigator.msSaveBlob(blob, filename); else { var blob = new Blob([‘stringhere’], { type: ‘text/csv;charset=utf-8’ }); var link = document.createElementNS(‘http://www.w3.org/1999/xhtml’, ‘a’); link.href = URL.createObjectURL(blob); link.download = ‘teams.csv’; link.click(); }

Images in SimpleCursorAdapter

I extended SimpleCursorAdapter, and while I did not use a ViewBinder here is my code for using an image stored as a blob in an sqlite database in a listview. This was adapted from an article I read here. My layout file for a row is: row_layout_two_line.xml <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”match_parent” android:layout_height=”match_parent” android:background=”@drawable/select_item”> … Read more

How can I insert large files in MySQL db using PHP?

You will want to check the MySQL configuration value “max_allowed_packet”, which might be set too small, preventing the INSERT (which is large itself) from happening. Run the following from a mysql command prompt: mysql> show variables like ‘max_allowed_packet’; Make sure its large enough. For more information on this config option see MySQL max_allowed_packet This also … Read more

How to insert / retrieve a file stored as a BLOB in a MySQL db using python

thedata = open(‘thefile’, ‘rb’).read() sql = “INSERT INTO sometable (theblobcolumn) VALUES (%s)” cursor.execute(sql, (thedata,)) That code of course works as written only if your table has just the BLOB column and what you want to do is INSERT, but of course you could easily tweak it to add more columns, use UPDATE instead of INSERT, … Read more

How to create an ArrayBuffer and data URI from Blob and File objects without FileReader?

I just put it here: var input = document.querySelector(“input[type=file]”); input.addEventListener(“change”, handleFiles, true); // for url window.URL = window.URL || window.webkitURL; function handleFiles(evnet) { var file = event.target.files[0]; document.querySelector(‘iframe’) .setAttribute(‘src’, window.URL.createObjectURL(file)); } <!DOCTYPE html> <html> <head> </head> <body> <form method=”get” entype=”multipart/form-data” target=”binaryFrame”> <input id=”#avatar” type=”file” name=”file” /> <input type=”submit” /> </form> <iframe name=”binaryFrame”></iframe> </body> </html>

Viewing Content Of Blob In phpMyAdmin

earlier versions of phpmyadmin had a setting called $cfg[‘ShowBlob’] = TRUE; That would allow you to view the contents of blobs in the browser. You should note that this would cause chaos if you were storing binary files in blobs, since you would see endless gobblygok in the browser window. There are some people (like … Read more