除文件名外无法获取文件参数? [英] Can't get file parameters except filename?

查看:80
本文介绍了除文件名外无法获取文件参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有带有表单的html页面,可以将数据和图像插入到数据库表中,但是当更新表单中的更新图像时,ajax只传递没有文件大小或文件tempFolder或任何其他参数的图像名称,因此上传失败。 />


我尝试过:



为什么上传的文件没有获得除文件名以外的任何其他参数? [ ^ ]

I have html page with form to insert data and images to DB table it works fine but when update images in update form ajax passes only image name without file size or file tempFolder or any other parameters, so the upload fails.

What I have tried:

why uploaded file doesn't get any other parameters Except file name?[^]

推荐答案

这是对的。您的服务器代码只获取文件名。传递给服务器的任何其他信息都被视为对客户端的安全风险。没有办法解决这个问题。



你得到的最好的是文件大小,一旦服务器端代码可以自行找出文件大小文件上传到服务器。
That's right. Your server code only gets the filename. Any other information passed to the server is considered a security risk to the client. There is no way around that.

The best you're going to get is the file size, which the server-side code can figure out on its own once the file is uploaded to the server.


这篇关于除文件名外无法获取文件参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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