PHP从上传的文本文件中读取? [英] PHP read from uploaded text file?

查看:104
本文介绍了PHP从上传的文本文件中读取?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我通过表单上传文本文件,是否可以直接从$ _FILES变量输出其内容,而不是先将其保存到服务器上?我知道这是安全隐患,但是只能在本地计算机上运行.

If I upload a text file via a form, is it possible to output its contents directly from the $_FILES variable rather than saving it onto the server first? I know this is a security risk, but it will only be run on a local machine.

任何建议表示赞赏.

谢谢.

推荐答案

文件在上传后即被保存到temp目录,但是您可以使用$_FILES['uploadedfile']['tmp_name']来读取它,而不必保存在永久位置.

The file is saved to temp directory the moment it's uploaded, but you can use $_FILES['uploadedfile']['tmp_name'] to read it without having to save in a permanent place.

这篇关于PHP从上传的文本文件中读取?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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