Ich splitte im Javascript ein Bild aus einem HTML5 File Field.
Das funktioniert. Der Upload per Ajax klappt auch. Ich kann die einzelnen Datenpakete auf dem Server in Textfile speichern, dann wieder auslesen, zusammensetzen und daraus das Bild wieder herstellen.
Nun möchte ich das aber in eine MySql-DB speichern. Und da weigert sich mysql das anzunehmen.
Ich bekomme die Meldung:
Die Daten im Datenbankfeld file_data habe ich jetzt gekürzt. Das wäre sonst für das Forum hier zu groß. Das Datenpaket ist jedenfalls in echt 2MB groß. Und ist ja letztendlich nur ein String.
In meiner Datenbankklasse steht das an Zeile 210 (falls einer fragt)
$this -> result = mysqli_query($this -> verbindung, $mysql);
Und $mysql enthät genau den obigen query String.
Aber das funktioniert bei allen meine Anwendungen, nur hier eben nicht.
Das ist meine Tabelle, in die das rein soll:
Der Longblob kann Dateien bis zu 4GB aufnehmen. Wieso steigt ann bei den 2MB das MySql aus? Wenn ich die Datenmenge verringere, indem ich einfach ein Drittel rauslösche, schreibt er das in die DB. Wieso sind reine 2MB Text zu groß für ein Longblob Feld? Ich lege die Textdatei eines solchen Datenpaketes mal auf meine Server zum ansehen.
http://download.psygonis.de/2_12_14_image_data_.data
Was mache ich da falsch?
Code:
var reader = new FileReader(); reader.onloadend = function () { var image_parts = []; // Since it contains the Data URI, we should remove the prefix and keep only Base64 string var b64 = reader.result.replace(/^data:.+;base64,/, ""); var currten_index = 0; // Spliting the b64 string in parts. while (b64.length > currten_index) { var start_split = currten_index; var end_split = currten_index + Math.min(b64.length - currten_index, _sliceSize); var b64_substr = b64.substr(start_split, end_split - start_split); image_parts.push(b64_substr); currten_index = end_split; } // Clean Memory delete b64; // Upload Image uploadImageArray(image_parts, start_split, end_split, picIndex, psyToken, psyKey); }; reader.readAsDataURL(file);
Nun möchte ich das aber in eine MySql-DB speichern. Und da weigert sich mysql das anzunehmen.
Ich bekomme die Meldung:
Code:
<br /> <b>Warning</b>: mysqli_query(): MySQL server has gone away in <b>D:\xampp\htdocs\projekte\uploadNew\upload2\DB\classesDB.php</b> on line <b>210</b><br /> <br /> <b>Warning</b>: mysqli_query(): Error reading result set's header in <b>D:\xampp\htdocs\projekte\uploadNew\upload2\DB\classesDB.php</b> on line <b>210</b><br /> REPLACE INTO psy_pic_cache (`session`, token, `key`, pic_index, part_id, parts_all, num_all, `start`, `end`, width, height, file_type, file_name, file_data) VALUES ('c9gk1iqgvuhla64pm4pe9t01to', '123456abcdefg', 'hijklmnop9874652', 2, 11, 14, 10, 26624000, 26959588, 0, 0, 'image/png', 'DSC03192.png', 'R3bAy+k5AG/ZXlW7anHVwZX3vPckg5Icc4qsEgOmAGZePexsfchorglMR8TAljt1VWWp2bMGdsW24BQBD......'
In meiner Datenbankklasse steht das an Zeile 210 (falls einer fragt)
$this -> result = mysqli_query($this -> verbindung, $mysql);
Und $mysql enthät genau den obigen query String.
Aber das funktioniert bei allen meine Anwendungen, nur hier eben nicht.
Das ist meine Tabelle, in die das rein soll:
Code:
CREATE TABLE `psy_pic_cache` ( `session` VARCHAR(50) NOT NULL DEFAULT '0' COLLATE 'utf8_unicode_ci', `token` VARCHAR(50) NOT NULL DEFAULT '0' COLLATE 'utf8_unicode_ci', `key` VARCHAR(50) NOT NULL DEFAULT '0' COLLATE 'utf8_unicode_ci', `pic_index` INT(5) NOT NULL DEFAULT '0', `part_id` INT(5) NOT NULL DEFAULT '0', `parts_all` INT(8) NULL DEFAULT NULL, `num_all` INT(8) NULL DEFAULT NULL, `start` BIGINT(20) NULL DEFAULT NULL, `end` BIGINT(20) NULL DEFAULT NULL, `width` BIGINT(8) NULL DEFAULT NULL, `height` BIGINT(8) NULL DEFAULT NULL, `file_type` VARCHAR(50) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci', `file_name` VARCHAR(50) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci', `file_data` LONGBLOB NULL DEFAULT NULL, `tsp` TIMESTAMP NULL DEFAULT current_timestamp(), PRIMARY KEY (`session`, `token`, `key`, `pic_index`, `part_id`) USING BTREE ) COMMENT='Upload Daten ' COLLATE='utf8_unicode_ci' ENGINE=InnoDB;
http://download.psygonis.de/2_12_14_image_data_.data
Was mache ich da falsch?
Kommentar