dongpao5658 2015-10-28 16:38
浏览 33

PHP使用utf-8编码访问图像

I have used scrapy(a python crawler framework), I crawled some images and dowload them,also I store the image online url in mysql table and after download I store the local path into mysql.now there is one problem, when I try to display the image with php, it can't access the image...it just display **404* my mysql table:

+-------------+-------------+------+-----+---------+----------------+
| Field       | Type        | Null | Key | Default | Extra          |
+-------------+-------------+------+-----+---------+----------------+
| id          | int(11)     | NO   | PRI | NULL    | auto_increment |
| brand       | varchar(45) | NO   |     | NULL    |                |
| series      | varchar(45) | NO   |     | NULL    |                |
| commodity   | varchar(45) | NO   |     | NULL    |                |
| designer    | varchar(45) | NO   |     | NULL    |                |
| year        | varchar(45) | NO   |     | NULL    |                |
| description | text        | NO   |     | NULL    |                |
| technology  | text        | NO   |     | NULL    |                |
| url         | text        | NO   |     | NULL    |                |
| local_url   | text        | NO   |     | NULL    |                |
| name        | text        | NO   |     | NULL    |                |
| downloaded  | tinyint(1)  | NO   |     | 0       |                |
| referer     | varchar(45) | NO   |     | NULL    |                |
+-------------+-------------+------+-----+---------+----------------+

I use url field store the online image url and local_url field store the local image path.
some data in local_url is as following:

agape/— Contenitori/EVO-N\_NIVIS\_ALTO.jpg?1415875406,agape/— Contenitori/EVO-N\_CONTENITORE.jpg?1415875446,agape/— Contenitori/FLAT\_XL\_CONT\_PUZZLE.jpg?1415875463,agape/— Contenitori/EVOLUZIONE\_CONT\_PUZZLE.jpg?1415875485 

I user comma to split the image path, the image stored in local is as following:

/var/www/images/agape/— Contenitori/xxx.jpg

the path contains space and other special charater,when I using php get the image from database and try to access the image,it can not be accessed..
the url try to access is as following:

http://45.32.255.165/images/agape/%E2%80%94%20Contenitori/EVO-L_660_PART_CASSETTO_R.jpg?1362501749

hope I describe my question clearly......

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器