为什么我的图片无法上传? [英] Why is my image not uploading?

查看:84
本文介绍了为什么我的图片无法上传?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个来自数据库的记录,包括当前为该记录存储的图像。然后,用户可以更新记录的信息,但问题是当我将带有表单的php页面中的新图像传递给处理数据库记录更新的脚本时,图像实际上并未传递。 />

这是将数据库中的记录带到页面的php:

展开 | 选择 | 换行 | 行号

解决方案

你正在使用


_POST [''ud_image''],但它不是假设是

_FILE?

如果这是一个更新,我实际上会通过使用当前值初始化值来启动代码,然后当提交按钮被命中时,收集新值并检查文件是否设置,如果没有,使用当前值,如果设置,使用上传的值。


希望有帮助。


I have a from that brings a record from the database, including the image that is currently stored for that record. The user can then update the information for the record, but the problem is that when I pass the new image from the php page with the form to the script that processes the update of the database record, the image is not actually passing.

This is the php that brings the record from the database to the page:

Expand|Select|Wrap|Line Numbers

解决方案

You''re using


_POST[''ud_image''], but isn''t it suppose to be a


_FILE?
If this is an update, I would actually start the code by initializing the values with the current values, then when the submit button gets hit, gather the new values and check if the file is set, if not, use the current value, if it is set, use the uploaded value.

Hope that helps.


这篇关于为什么我的图片无法上传?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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