blob

Informix 7.3 isql insert statement - text/blob/clob field insert error

早过忘川 提交于 2019-12-18 09:26:58
问题 Is a way around this?? I am trying to insert some data into a table whose structure is: Column name Type Nulls crs_no char(12) no cat char(4) no pr_cat char(1) yes pr_sch char(1) yes abstr text yes The type of the last field reads 'text', but when trying to insert into this table, I get this error: insert into crsabstr_rec values ("COMS110","UG09","Y","Y","CHEESE"); 617: A blob data type must be supplied within this context. Error in line 1 Near character position 66 So this field is some

How to insert BLOB datatype

送分小仙女□ 提交于 2019-12-18 08:51:26
问题 I'm using the following code to insert into a blob field: MySql.Data.MySqlClient.MySqlConnection conn; MySql.Data.MySqlClient.MySqlCommand cmd; conn = new MySql.Data.MySqlClient.MySqlConnection(); cmd = new MySql.Data.MySqlClient.MySqlCommand(); string SQL; int FileSize; byte[] rawData; FileStream fs; conn.ConnectionString = "server=192.168.1.104;uid=root;" + "pwd=root;database=cady234;"; fs = new FileStream(@"d:\Untitled.gif", FileMode.Open, FileAccess.Read); FileSize = (int)fs.Length;

Trying to download Blob via PHP / MySQL

你说的曾经没有我的故事 提交于 2019-12-18 06:58:27
问题 This is one I just can't figure out: I have successfully built an upload feature on a web page to upload files to a MySQL Database. When I go on the server and open them via phpMyAdmin, they all look fine... txt, jpg, pdf, etc. Yet, after putting together THIS thing (below) to download it, I get a strange problem: All of the text documents (and all other types of files, after I change the extension to 'txt') contain HTML code of the page itself, followed by the original content! Also,

How to store a file in a mysql database using blob

送分小仙女□ 提交于 2019-12-18 05:25:16
问题 I have searched about this matter a lot but, I didn't get a proper solution for my problem, I have following method for storing a file using java, private void uploadFile() throws Exception { Class.forName("com.mysql.jdbc.Driver").newInstance(); connection = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/FileDb?autoReconnect=true", "user1", "123789"); System.out.println("DB connection extablished!"); PreparedStatement statement = connection.prepareStatement("INSERT INTO FilesTb(

Create binary blob in JS

隐身守侯 提交于 2019-12-18 04:49:07
问题 I'm generating a file client-side, I have the data in hexadecimal and just want to let the user download the generated file. var blob = new Blob([hexData], {type: "application/octet-stream"}); console.log(URL.createObjectURL(blob)); The resulting file is a plain-text file containing hex data in ASCII. How can I force the Blob to contain the binary data as is and not as text? 回答1: Derived from @Musa's solution above so I cannot take credit, but it's clearer to write this as an answer than my

com.mysql.jdbc.PacketTooBigException

允我心安 提交于 2019-12-18 03:56:43
问题 I am storing images in MYSQL. I have table as CREATE TABLE myTable (id INT, myImage BLOB); When I am trying to insert 4.7MB file, I am getting exception as com.mysql.jdbc.PacketTooBigException: Packet for query is too large (4996552 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable. I believe this is related to image size only. Is there any other variable type that I can use? Update 1 As per older SO question, I also tried with MEDIUMBLOB but

How do I use BCP or Sql Server Management Studio to get BLOB data out of Sql Server?

这一生的挚爱 提交于 2019-12-18 02:50:04
问题 I'm sorry if this question has been asked already, but I couldn't find it anywhere. I have a table that stores files as BLOBS. The column that holds the file is an image datatype. I would like to be able to extract the binary data out of the column and turn it in to an actual file. I would ideally like to be able to do this with BCP or management studio if possible. I have tried BCP, but for some reason when I try and pull out an office document Word thinks it's corrupt. Here's what I've

Download BLOB content using specified charset

放肆的年华 提交于 2019-12-17 22:57:44
问题 Is possible to change the Blob charset really? I'm trying it for hours but it doesn't workds. See this. jQuery("#download").click(function() { var csv_content = jQuery("#csv").val(), download = document.createElement("a"), blob = new Blob([csv_content], { type: "text/csv;charset=ISO-8859-1" }); download.href = window.URL.createObjectURL(blob); download.download = "test.csv"; var event = document.createEvent("MouseEvents"); event.initMouseEvent( "click", true, false, window, 0, 0, 0, 0, 0 ,

Blob saved as [object Object] Nodejs

£可爱£侵袭症+ 提交于 2019-12-17 22:39:34
问题 I want to record audio from the microphone with HTML5, then send it to the server to be saved. Currently however, the saved file just contains [object Object] Here are some snippets of my code. Frontend: console.log(blob); $http.post('/api/save_recording', blob) .success(function(new_recording) { console.log("success"); }) The log prints: Blob {type: "audio/wav", size: 237612, slice: function} success Backend: exports.saveRecording = function(req, res) { console.log(req.body); fs.writeFile(

File upload using java websocket API and Javascript

冷暖自知 提交于 2019-12-17 22:37:14
问题 I'm studying websocket and have done chat program with websocket/json. But I'm stuck at file uploading ATM. Any advice & answer would be thankful. Server side: package websocket; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.nio.ByteBuffer; import javax.websocket.CloseReason; import javax.websocket.EndpointConfig; import javax.websocket.OnClose; import javax.websocket.OnError; import javax.websocket