Pull Image From MySQL And Display It On My Website Via JqueryExtract Text from a Binary File (using Python 2.7 on Windows 7)Binary data returns a blank stringCan anyone identify this encoding?Converting data from serial/usb using PySerialHow to play the response I got to convert text into speech using voicerss?python encoding gzip stringPython OpenCV Image to byte string for json transferwhat is the type of response is this?Reading binary from pickle filePython 3 : keep string of hex commands intact while printing and formatting
Is this saw blade faulty?
Would this string work as string?
Why doesn't Gödel's incompleteness theorem apply to false statements?
Can you describe someone as luxurious? As in someone who likes luxurious things?
Did I make a mistake by ccing email to boss to others?
How do you say "Trust your struggle." in French?
Center page as a whole without centering each element individually
Can a Knock spell open the door to Mordenkainen's Magnificent Mansion?
Capacitor electron flow
How would a solely written language work mechanically
What do the positive and negative (+/-) transmit and receive pins mean on Ethernet cables?
1 John in Luther’s Bibel
Is there any common country to visit for persons holding UK and Schengen visas?
Hashing password to increase entropy
Reason why a kingside attack is not justified
Has the laser at Magurele, Romania reached a tenth of the Sun's power?
Trouble reading roman numeral notation with flats
Why does the frost depth increase when the surface temperature warms up?
Is there a distance limit for minecart tracks?
Connection Between Knot Theory and Number Theory
Do native speakers use "ultima" and "proxima" frequently in spoken English?
Why didn’t Eve recognize the little cockroach as a living organism?
Do I have to take mana from my deck or hand when tapping this card?
Why is indicated airspeed rather than ground speed used during the takeoff roll?
Pull Image From MySQL And Display It On My Website Via Jquery
Extract Text from a Binary File (using Python 2.7 on Windows 7)Binary data returns a blank stringCan anyone identify this encoding?Converting data from serial/usb using PySerialHow to play the response I got to convert text into speech using voicerss?python encoding gzip stringPython OpenCV Image to byte string for json transferwhat is the type of response is this?Reading binary from pickle filePython 3 : keep string of hex commands intact while printing and formatting
I'm needing help with pulling an image file from MySQL using SQLAlchemy thats binary, but i keep getting errors. My goal is to pull from DB, send to my JQuery via jsonify, but i cant figure it out.
@app.route('/add', methods=['GET', 'POST'])
def add():
Title = request.form['Title']
Body = request.form['Body']
Image = request.files['File']
print(Image)
add = Text(Title, Body, Image.read(), Image.filename)
db.session.add(add)
db.session.commit()
return jsonify('sent')
@app.route('/pull')
def pull():
get = Text.query.first()
my_str = get.Image
pull = BytesIO(my_str)
print(pull)
return jsonify(pull)
ERROR:
TypeError: Object of type 'BytesIO' is not JSON serializable
BytesIO:
<_io.BytesIO object at 0x0508E390>
Binary:
b'xffxd8xffxe0x00x10JFIFx00x01x01x01x00Hx00Hx00x00xffxe2x0cXICC_PROFILEx00x01x01x00x00x0cHLinox02x10x00x00mntrRGB XYZ x07xcex00x02x00tx00x06x001x00x00acspMSFTx00x00x00x00IEC sRGBx00x00x00x00x00x00x00x00x00x00x00x00x00x00xf6xd6x00x01x00x00x00x00xd3-HP x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x11cprtx00x00x01Px00x00x003descx00x00x01x84x00x00x00lwtptx00x00x01xf0x00x00x00x14bkptx00x00x02x04x00x00x00x14rXYZ ECT.....
python json flask binary byte
add a comment |
I'm needing help with pulling an image file from MySQL using SQLAlchemy thats binary, but i keep getting errors. My goal is to pull from DB, send to my JQuery via jsonify, but i cant figure it out.
@app.route('/add', methods=['GET', 'POST'])
def add():
Title = request.form['Title']
Body = request.form['Body']
Image = request.files['File']
print(Image)
add = Text(Title, Body, Image.read(), Image.filename)
db.session.add(add)
db.session.commit()
return jsonify('sent')
@app.route('/pull')
def pull():
get = Text.query.first()
my_str = get.Image
pull = BytesIO(my_str)
print(pull)
return jsonify(pull)
ERROR:
TypeError: Object of type 'BytesIO' is not JSON serializable
BytesIO:
<_io.BytesIO object at 0x0508E390>
Binary:
b'xffxd8xffxe0x00x10JFIFx00x01x01x01x00Hx00Hx00x00xffxe2x0cXICC_PROFILEx00x01x01x00x00x0cHLinox02x10x00x00mntrRGB XYZ x07xcex00x02x00tx00x06x001x00x00acspMSFTx00x00x00x00IEC sRGBx00x00x00x00x00x00x00x00x00x00x00x00x00x00xf6xd6x00x01x00x00x00x00xd3-HP x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x11cprtx00x00x01Px00x00x003descx00x00x01x84x00x00x00lwtptx00x00x01xf0x00x00x00x14bkptx00x00x02x04x00x00x00x14rXYZ ECT.....
python json flask binary byte
add a comment |
I'm needing help with pulling an image file from MySQL using SQLAlchemy thats binary, but i keep getting errors. My goal is to pull from DB, send to my JQuery via jsonify, but i cant figure it out.
@app.route('/add', methods=['GET', 'POST'])
def add():
Title = request.form['Title']
Body = request.form['Body']
Image = request.files['File']
print(Image)
add = Text(Title, Body, Image.read(), Image.filename)
db.session.add(add)
db.session.commit()
return jsonify('sent')
@app.route('/pull')
def pull():
get = Text.query.first()
my_str = get.Image
pull = BytesIO(my_str)
print(pull)
return jsonify(pull)
ERROR:
TypeError: Object of type 'BytesIO' is not JSON serializable
BytesIO:
<_io.BytesIO object at 0x0508E390>
Binary:
b'xffxd8xffxe0x00x10JFIFx00x01x01x01x00Hx00Hx00x00xffxe2x0cXICC_PROFILEx00x01x01x00x00x0cHLinox02x10x00x00mntrRGB XYZ x07xcex00x02x00tx00x06x001x00x00acspMSFTx00x00x00x00IEC sRGBx00x00x00x00x00x00x00x00x00x00x00x00x00x00xf6xd6x00x01x00x00x00x00xd3-HP x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x11cprtx00x00x01Px00x00x003descx00x00x01x84x00x00x00lwtptx00x00x01xf0x00x00x00x14bkptx00x00x02x04x00x00x00x14rXYZ ECT.....
python json flask binary byte
I'm needing help with pulling an image file from MySQL using SQLAlchemy thats binary, but i keep getting errors. My goal is to pull from DB, send to my JQuery via jsonify, but i cant figure it out.
@app.route('/add', methods=['GET', 'POST'])
def add():
Title = request.form['Title']
Body = request.form['Body']
Image = request.files['File']
print(Image)
add = Text(Title, Body, Image.read(), Image.filename)
db.session.add(add)
db.session.commit()
return jsonify('sent')
@app.route('/pull')
def pull():
get = Text.query.first()
my_str = get.Image
pull = BytesIO(my_str)
print(pull)
return jsonify(pull)
ERROR:
TypeError: Object of type 'BytesIO' is not JSON serializable
BytesIO:
<_io.BytesIO object at 0x0508E390>
Binary:
b'xffxd8xffxe0x00x10JFIFx00x01x01x01x00Hx00Hx00x00xffxe2x0cXICC_PROFILEx00x01x01x00x00x0cHLinox02x10x00x00mntrRGB XYZ x07xcex00x02x00tx00x06x001x00x00acspMSFTx00x00x00x00IEC sRGBx00x00x00x00x00x00x00x00x00x00x00x00x00x00xf6xd6x00x01x00x00x00x00xd3-HP x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x11cprtx00x00x01Px00x00x003descx00x00x01x84x00x00x00lwtptx00x00x01xf0x00x00x00x14bkptx00x00x02x04x00x00x00x14rXYZ ECT.....
python json flask binary byte
python json flask binary byte
asked Mar 7 at 20:23
Trey ThomasTrey Thomas
217
217
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55052239%2fpull-image-from-mysql-and-display-it-on-my-website-via-jquery%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55052239%2fpull-image-from-mysql-and-display-it-on-my-website-via-jquery%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown