简体   繁体   English

Android将图像上传到Mysql

[英]Android Upload Image To Mysql

晚上好。我一直都在搜寻Google,令我惊讶的是,我发现实际上您不能将图像上传到mysql服务器,因为它不会显示它。我几乎不相信它,但这是我的情况。我得到了服务器从亚马逊(EC2)并获得了RDS数据库。我能够与亚马逊的mysql数据库建立连接并能够向其发送字符串(主要是用户键入的单词),现在我想知道是否可以从中上传图像android到mysql数据库,以后再从mysql数据库中检索该图像?任何结论将不胜感激...开发中,它只剩下一天让我宣布我的app。请帮助我!

You can store the image in a MySQL database using a BLOB data type. 可以使用BLOB数据类型将图像存储在MySQL数据库中。 See this answer here: 在这里查看此答案:

Images in MySQL MySQL中的图像

However, this is not always the best decision in terms of performance. 但是,就性能而言,这并不总是最好的决定。 One of the suggested solutions is to upload the image to a server and store the location of the image in the MySQL database instead of storing the actual image data. 建议的解决方案之一是将图像上传到服务器,并将图像的位置存储在MySQL数据库中,而不是存储实际的图像数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM