如何为文件上传按钮设置值

2022-01-09 00:00:00 upload php

我有一个应用程序,我们可以在其中选择图像并存储它,当用户需要更改图像的属性(如高度、宽度、图像)时,他将去编辑页面并对其进行编辑..但是,如果用户仅更改高度和宽度而不更改图像,则图像将不会显示,因为图像值不会为文件获取/设置...那么我们如何动态设置文件上传按钮的路径...

I have an application where we can select image and store it and when user needs to change a properties of image like height,width,image he will go to edit page and he will edit it.. But when the user does not change image if he changes only height and width then the image will no display because the image value will not fetch/set for file... So how can we dynamically set path for a file upload button...

推荐答案

答案很简单;你不能.

只需检查图像是否设置.如果是这样,请上传新图像.如果没有,请不要将图像替换为您已有的图像.这是一项安全措施,您不希望能够上传所选网站的文件.

Just check whether the image is set. If so, upload the new image. If not, don't replace the image with the image you already have. This is a safety measure, you don't want to be able to upload a file of the websites choise.

相关文章