哪种技术更好地将文件上传到站点? [英] which technology is better to upload files to site?

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

问题描述

哪种技术更好地将文件上传到站点,PHP或JQuery.

which technology is better to upload files to site, PHP or JQuery.

推荐答案

jQuery是一个JavaScript库,PHP是一种后端脚本语言.您问的是错误的问题.
jQuery is a javascript library, PHP is a back-end scripting language. You''re asking the wrong question.


请参阅我对这个问题的评论.克里斯是绝对正确的.从一开始就很难解释所有内容,因为从一开始就可能需要一整篇文章供您真正需要的绝对初学者使用.所以我只给你一个基本的提示.

首先,您需要客户端和服务器端都将文件从客户端传输到服务器.在客户端,您只需要一个带有"post"方法的HTML表单即可将HTTP请求发送到服务器.该请求将包含要上传文件的完整内容.服务器端需要阅读帖子,并对通过HTTP协议发送的数据进行处理,例如-写入文件.在客户端,您也可以使用AJAX执行发布,在这里您可以使用jQuery,也可以使用jQuery.通常,没有任何客户端脚本的表单就可以了.

在服务器端,您需要一些服务器端代码来处理数据,如上所述.在服务器端技术之间进行选择:PHP,ASP.NET,带有WSGI的Python等-即可命名.即使在这里,谓词更好"也没有定义-它取决于.

—SA
Please see my comment to the question. Chris is absolutely right. It''s pretty hard to explain everything from the very beginning, because from the very beginning it could take a whole article for the absolute beginners you might really need. So I''ll just give you a basic hint.

To start with: you need both client side and server side to transfer a file from a client to a server. On a client side, you need just an HTML form with the method "post" to send an HTTP request to the server. This request will contain the full content of the file to be uploaded. The server side needs to read the post and do something with the data sent over the HTTP protocol, for example — write the file(s). On the client side, you can also perform the post using AJAX, and here you may or may use jQuery. Usually, a form without any client-side scripting would do just fine.

On the server side, you need some server-side code the process the data as I explained above. Here comes the choice between the server-side technologies: PHP, ASP.NET, Python with WSGI, etc. — you name it. Even here, the predicate "better" is not defined — it depends.

—SA


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

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