Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
676 views
in Technique[技术] by (71.8m points)

php - MySQL - Uploading Image To BLOB Max Upload Size?

I'm using file uploading for images into a BLOB in a MySQL database, for some reason when I upload some pictures I noticed they weren't completely rendered, I then tried uploading directly into PHPMyAdmin when it then showed (Max: 64KiB) I luckily enough run my own server so I thought to go check my php.ini for max file upload size, it's set to 250MB. So my question is,

Where is the max filesize for MySQL BLOB Uploads??

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It depends on the type of your column.

From MySQL documentation:, section Storage Requirements for String Types:

TINYBLOB

L+1 bytes, where L < 28 (256 bytes)

BLOB

L+2 bytes, where L < 216 (65 kilobytes)

MEDIUMBLOB

L+3 bytes, where L < 224 (16 megabytes)

LONGBLOB

L+4 bytes, where L < 232 (4 gigabytes)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...