blob

MariaDB Insert BLOB Image

血红的双手。 提交于 2019-12-11 03:23:10
问题 What I want to do? I want to insert a picture into a MariaDB database using the command line, using the LOAD_FILE fuction. What's wrong? I always get a NULL return. I don't want a solution like: This is bad style and I haven't seen this so far - try to store the full path! I want to store this picture in this database and not the path. System mysql Ver 15.1 Distrib 10.1.17-MariaDB, for Linux (x86_64) using readline 5.1 ArchLinux 4.7.2-1-ARCH A picture called Test.jpg (817KB) under /home/user

Informix (C#): How do I properly set/unset a blob field?

别说谁变了你拦得住时间么 提交于 2019-12-11 03:03:17
问题 IBM Informix SDK: Statement: Update mytable set myblobcolumn = ? where myid = 1; using (IfxConnection conn = GetIfxConnection()) using (IfxCommand cmd = new IfxCommand(updateSql, conn)) { var param = new IfxParameter("myblobcolumn", IfxType.Blob) { IsNullable = true }; cmd.Parameters.Add(param).Value = DBNull.Value cmd.ExecuteNonQuery(); //ERROR [HY000] [Informix .NET provider][Informix]Illegal attempt to use Text/Byte host variable. } If I update it with another IfxBlob object it works fine,

Wait for user to finish downloading a blob in Javascript

♀尐吖头ヾ 提交于 2019-12-11 02:34:53
问题 In Javascript, I'm creating a number of blobs that I want to prompt the user to save as files. At the moment, I'm doing that using URL.createObjectURL , placing the URL in a link, and simulating a click to the link. (Of course I call URL.revokeObjectURL to release the URL so the blob can be discarded after the user saves it.) I have a loop that runs through and does this for each blob I want the user to save. At least on Firefox, triggering the link is an asynchronous operation; I call click(

Building link to export sheet as PDF

南楼画角 提交于 2019-12-11 02:31:26
问题 I've been trying to export specific sheets as PDFs for mailing purposes, and found that I needed them to be in a specific format. I went around looking for code to use and ended up finding this: https://issuetracker.google.com/issues/36761058#comment24 Although I have incorporated quite a bit of my own code, a good chunk of it is the same as in the link I posted above, and it works quite well except for one thing. As seen in the code below, I've chosen to have fit width as "false" since some

java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column

杀马特。学长 韩版系。学妹 提交于 2019-12-11 02:24:29
问题 I am using a simple interface (in jsf 1.2 and rich faces 3.3.2, Oracle 11g R1) to let user select picture with rich:fileUpload and save in a table. As a test, i created following table. CREATE TABLE TEST ( MIME_TYPE VARCHAR2 (1000), PHOTO BLOB, STUDENT_ID NUMBER NOT NULL ) code snippet to save the picture to BLOB field is as follows. //......From the uploadFile Listener public void listener(UploadEvent event) throws Exception { ... item = event.getUploadItem(); ... StudentPhotoDAO dao = new

Save a response body as file with FileSaver and blob

杀马特。学长 韩版系。学妹 提交于 2019-12-11 01:49:46
问题 I want to download and save a file from an api. The name of my file is text.txt but the saved file is called: _text.txt_ and the content of this file is: [object Object] This is my function to download as file: const options = { headers: new HttpHeaders().append('Authorization', this.oAuthService.getAccessToken()), params: new HttpParams().append('responseType', 'text'), observe: 'response' as 'response' } return this.http.get(this.fileServerUrl + 'file/download/' + filename + '/' + version,

Selecting Blob from MYSQL, getting null

笑着哭i 提交于 2019-12-11 01:39:23
问题 Is there anything special I need to do when selecting a blob from MySQL? I get a NULL for the following (data is a mediumblob, file_extension is varchar): $sql = "SELECT data, file_extension FROM table1 WHERE table1.id = ?"; $q = $con->prepare($sql); $q->execute(array(1)); if ($q->rowCount() == 0) { disconnectSqlConnection($con); $arr = array('success' => 'false', 'error' => -2); return json_encode($arr); } else { $row = $q->fetch(); $arr = array('success' => 'true', 'data' => $row[0],

Save documents as BLOB in SQL or on file system

元气小坏坏 提交于 2019-12-11 01:38:01
问题 For a (.net) web application I need to allow users to store many documents (pdf, .docx etc.). My first thoughts were to save all the documents as a BLOB in a SQL (Express) database. But how will my database grow? Is it better to save all the documents into the file system? Personally I still think that I'm better of saving the documents into the database, because of performance. But I'm not sure and curious what you folks think. Edit - My conclusion: If the file size is less then 1Mb and/or

Convert VarBinary RTF blob to text in MS SQL

岁酱吖の 提交于 2019-12-11 01:27:35
问题 I am using SQL server - 2008. Column Datatype - VarBinary RTF File is compressed and saved to this varbinary column. Now how to access and view data in RTF file using SQL ? it's returns this: 㠰た㠴弰巎楛㵤㠵㜸ㄲ㠴. etc. Sample Tried Code here: http://rextester.com/YOFHK34016 any solution to this. in 2008 Decompress and compress function not work. how i can get RTF file as it is to text. 回答1: That's works for me: select convert(varchar(max),convert(varbinary(max),bv.value)) from blobValue bv Instead

PHP PDO MS Access how to read blob images?

不羁岁月 提交于 2019-12-11 01:24:23
问题 I have images as BLOB's in an MS ACCESS database. I have so far used them with odbc acces from PHP and it works fine. Here comes the simplified program: code: <?php ini_set("odbc.defaultlrl", "5M"); $dbName = $_SERVER["DOCUMENT_ROOT"]."\\..\db\\teknofo.mdb"; $con = odbc_connect("Driver={Microsoft Access Driver (*.mdb)};Dbq=".$dbName,'','') or die('Ups'); ob_clean(); header('Content-Type: image/*'); $sql = "SELECT photo FROM Medlemmer WHERE Id=17"; $rd = odbc_exec($con, $sql); if (odbc_fetch