如何在php和mysql的在线文件夹中保存图像 [英] How to save a image in a online folder in php and mysql

查看:75
本文介绍了如何在php和mysql的在线文件夹中保存图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想上传图片并同时保存在数据库和文件夹中。代码在localhost(wamp服务器)中运行时正常运行,但是当我将整个代码上传到网站时..文件正确上传并保存在数据库中但不保存在文件夹中......意味着它找不到文件夹的路径,必须保存图像............ plz帮助尽快解决这个问题....我也在网上找到但找不到任何写代码......

I wanted to upload a image and save in the database and in a folder simultaneously.The code is properly run when run in a localhost(wamp server), but when i upload whole code to the website..file is uploaded correctly and save in database but not save in a folder......means it doesnot find the path of folder where have to save image...........plz help to resolve this problem as soon as possible....I also find on the net but doesnot find any write code......

推荐答案

听起来像是一个相对路径问题。这是结构化网站在开发和部署时面临的最常见问题之一。



有一种方法可以处理URL'。阅读: ResolveUrl [ ^ ]。



我建议您在设置控件/图像源之前使用此提示并正确解析路径:解决多文件夹网站中的路径 [ ^ ]
Sounds like it is a relative path issue. This is one of the most common issue faced in a structured website while development and deployment.

There is a method exposed to handle URL''s. Have a read: ResolveUrl[^].

I would suggest you to use this Tip and resolve the path correctly before setting the control/image source: Resolving Paths in a Multi-Folder WebSite[^]


函数move_uploaded_file是有用!

注意参数,没关系。
the function move_uploaded_file is useful !
notice the params , it will be ok .


这篇关于如何在php和mysql的在线文件夹中保存图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆