如何使用 php 实现 OF 文件选择器?
我需要用 php 实现一个操作系统文件选择器,但我不知道如何去做。 有人可以引导我走向正确的方向吗?
I need to implement an OS file chooser with php but I don't know how to go about doing this.
Can somebody guide me in the right direction?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一个基本的文件选择表格。
这是处理表单的基本 php。
您可以在这里阅读更多内容。
http://www.w3schools.com/php/php_file_upload.asp
This is a basic file choosing form.
This is the basic php to handle the form.
You can read more here.
http://www.w3schools.com/php/php_file_upload.asp
如果您使用 php 驱动桌面应用程序,请使用 UI 工具包的方法,例如
GTKFileChooser
。如果您使用 php 提供网页服务,请注意,服务器只能将 HTML 和 JavaScript 发送到客户端,而不能本机打开网页。在 HTML 代码中使用
元素:
您可以使用
提交
方法。如果您将整个表单放入 iframe 中,您可以执行以下操作:所以在后台。有关输入字段的详细信息,请参阅 HTML5 标准。有关提交表单后如何处理文件的信息,请查看 PHP 手册。
If you're using php to drive a desktop application, use the method of your UI toolkit, such as
GTKFileChooser
.If you're using php to serve webpages, note that the server can only send HTML and JavaScript to the client, and not natively open webpages. Use an
<input>
element in your HTML code:You can submit the form automatically from JavaScript with the
submit
method. If you place the whole form in an iframe, you can do so in the background.For details on the input field, consult the HTML5 standard. For information on how to handle the file once the form is submitted, have a look at the php manual.