上传文件到网站? [英] Upload a file to website?

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

问题描述

大家好,我只是想知道,你们如何使用 PHP 将文件直接上传到您的网站?

Hey guys i was just wondering, how do you use PHP to upload a file directly to your website?

例如:

用户使用浏览按钮查找要上传的文件,然后一旦选定的文件目录出现在文本框中,当他们单击上传"按钮时,它就会上传到名为上传"的网站上的目录.

Person uses a browse button to look for file to upload, then once selected file directory comes up in a textbox and when they click and "upload" button it uploads to a directory on the website named "uploads".

有人可以告诉我如何做到这一点,也许可以解释一下或将我链接到对我有帮助的资源吗?

Could someone tell me how to do this and maybe explain a little about or link me to a resource which will help me?

谢谢.

推荐答案

一切都在 PHP 手册中的处理文件上传 部分.

我建议避免使用 MAX_FILE_SIZE 隐藏字段,因为 它不是任何标准的一部分,没有已知的浏览器支持,很容易将它的值修改为 影响服务器端的 PHP 行为.

I'd recommend to avoid using the MAX_FILE_SIZE hidden field since it's not part of any standard, there is no known browsers support and it's easy to modify it's value to affect PHP behavior on the server side.

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

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