简体   繁体   English

为$ _FILES选择值[ <filename> ] [“ tmp_name”]

[英]Choose value for $_FILES[<filename>][“tmp_name”]

Is there a way to client-side choose the value for $_FILES[<filename>]["tmp_name"] instead of having it be randomly generated? 有没有一种方法可以让客户端在$_FILES[<filename>]["tmp_name"]选择一个值,而不是随机生成它? For example, is there some type of attribute I can somehow append to the file itself, called "tmp_name", so that when it's uploaded the receiving PHP script reads my tmp_name rather than generating a random one? 例如,是否可以通过某种方式将某种类型的属性附加到文件本身上,称为“ tmp_name”,以便在上载时,接收PHP脚本读取我的 tmp_name而不是生成随机的?

No. 没有。

The uploaded file data is stored in a temporary file which is randomly named . 上载的文件数据存储在一个临时文件中 ,该文件 名为 And it's good that the user has no influence on that, it could be a security issue if he did. 最好让用户对此没有影响,如果这样做的话,则可能是安全问题。 You can configure the directory in which this temporary file will be created in your php.ini , but that's all. 可以在php.ini中配置在其中创建此临时文件的目录,仅此而已。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM