如何在 Perl 中将图像添加到表中?
我使用 Perl DBI 开发了一个数据库,并使用 Perl CGI 进行显示。您能否建议将图像添加到数据库中的表格及其背景的语法。
I have developed a database using Perl DBI and display using Perl CGI. Can you please suggest syntax for adding an image to the table and its background in the database.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我只需插入一个包含图像地址/名称的文本字段,将图像放置在目录中并在运行时加载它们。
I would just insert a text field containing the address/name of the image, place the images in a directory and load them at runtime.
将二进制数据插入定义为保存 blob 的字段中。只要确保只插入二进制数据即可。插入的方式与将文本插入文本字段的方式相同。
您还可以将图像的路径存储在文本字段中,然后通过该路径检索图像。
Insert the binary data into a field defined to hold blobs. Just be certain that only binary data gets inserted. Insertion can be done the same way you insert text into a text field.
You can also store the path to the image in a text field and later retrieve the image via that path.