<bdo id='TNr5w'></bdo><ul id='TNr5w'></ul>

<i id='TNr5w'><tr id='TNr5w'><dt id='TNr5w'><q id='TNr5w'><span id='TNr5w'><b id='TNr5w'><form id='TNr5w'><ins id='TNr5w'></ins><ul id='TNr5w'></ul><sub id='TNr5w'></sub></form><legend id='TNr5w'></legend><bdo id='TNr5w'><pre id='TNr5w'><center id='TNr5w'></center></pre></bdo></b><th id='TNr5w'></th></span></q></dt></tr></i><div id='TNr5w'><tfoot id='TNr5w'></tfoot><dl id='TNr5w'><fieldset id='TNr5w'></fieldset></dl></div>

  1. <tfoot id='TNr5w'></tfoot>

    <small id='TNr5w'></small><noframes id='TNr5w'>

  2. <legend id='TNr5w'><style id='TNr5w'><dir id='TNr5w'><q id='TNr5w'></q></dir></style></legend>

    1. 创建自定义上传进度条

      Creating a custom upload progress bar(创建自定义上传进度条)

      1. <legend id='Aao9g'><style id='Aao9g'><dir id='Aao9g'><q id='Aao9g'></q></dir></style></legend>
        • <tfoot id='Aao9g'></tfoot>
            • <bdo id='Aao9g'></bdo><ul id='Aao9g'></ul>

              <small id='Aao9g'></small><noframes id='Aao9g'>

              <i id='Aao9g'><tr id='Aao9g'><dt id='Aao9g'><q id='Aao9g'><span id='Aao9g'><b id='Aao9g'><form id='Aao9g'><ins id='Aao9g'></ins><ul id='Aao9g'></ul><sub id='Aao9g'></sub></form><legend id='Aao9g'></legend><bdo id='Aao9g'><pre id='Aao9g'><center id='Aao9g'></center></pre></bdo></b><th id='Aao9g'></th></span></q></dt></tr></i><div id='Aao9g'><tfoot id='Aao9g'></tfoot><dl id='Aao9g'><fieldset id='Aao9g'></fieldset></dl></div>
                <tbody id='Aao9g'></tbody>

              1. 本文介绍了创建自定义上传进度条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我见过所有的上传进度条插件、小部件等——它们都很糟糕.它们要么太笨重,包含太多无用的代码,要么无法正常工作.

                I have seen all the upload progress bar plugins, widgets, etc. – they all suck. They're either too bulky with too much useless code or they don't work.

                我想知道在哪里可以阅读有关如何显示简单上传进度指示器的信息.大多数浏览器在下方都有一个状态进度条,但在与客户打交道时仅使用它不是很专业.

                What I want to know is where I can read up on how to display an easy upload progress indicator. Most browsers have a status progress bar on them below, but it isn't very professional to use just that when dealing with clients.

                浏览器是如何做到的?我想知道浏览器如何工作以指示上传状态的内部结构,以便我可以使用 PHP &jQuery.

                How does the browser do it? I want to know the internals of how the browser works with for indicating the status of something uploading so that maybe I can make something using PHP & jquery.

                谢谢.

                推荐答案

                既然要使用 PHP,那我先从 uploadprogress 扩展(默认情况下,在上传完成之前,PHP 不会为您提供任何数据;此扩展提供此类服务器端功能).请注意,它需要 PHP 5.2+,并且可能对配置选项很挑剔.另请参阅其 评论和演示和故障排除提示).PHP 文档评论中提供了一个简短的概述.

                Since you want to use PHP, I'd start with the uploadprogress extension (PHP doesn't, by default, give you any data about until the upload is completed; this extension provides such server-side functionality). Note that it requires PHP 5.2+ and can be picky about configuration options. Also see its commentary and demo and troubleshooting hints). A short overview available in PHP documentation comments.

                使用扩展程序,您可以获得一些上传统计信息;然后您可以通过 AJAX 轮询服务器并更新某种进度条.

                Using the extension, you can get some stats on the upload; then you can poll the server through AJAX and update some sort of progress bar.

                更具体一点:

                • 获取表单的唯一标识符,并将其包含在隐藏字段中
                • 上传应该在 IFRAME 中运行 - 某些浏览器不允许 DOM 更新到运行上传的同一页面
                • 通过 AJAX 轮询服务器(使用标识符指定您感兴趣的上传内容)并解析结果(IIRC,您会得到类似bytes_uploaded => 123, content-length=> 1000")
                • 更新您的进度条(显示方式由您决定,我使用x% done"加上图形条)
                • 表单上传成功后重定向整个页面

                (哦,顺便说一句,检查 PHP 的 upload_max_filesize 和 post_max_size 设置,因为它们都限制了最大上传大小)

                (Oh, and btw, check PHP's upload_max_filesize and post_max_size settings, as both limit the maximum upload size)

                这篇关于创建自定义上传进度条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                    • <bdo id='zIZgz'></bdo><ul id='zIZgz'></ul>
                        <tfoot id='zIZgz'></tfoot>

                        <small id='zIZgz'></small><noframes id='zIZgz'>

                          <tbody id='zIZgz'></tbody>

                        <i id='zIZgz'><tr id='zIZgz'><dt id='zIZgz'><q id='zIZgz'><span id='zIZgz'><b id='zIZgz'><form id='zIZgz'><ins id='zIZgz'></ins><ul id='zIZgz'></ul><sub id='zIZgz'></sub></form><legend id='zIZgz'></legend><bdo id='zIZgz'><pre id='zIZgz'><center id='zIZgz'></center></pre></bdo></b><th id='zIZgz'></th></span></q></dt></tr></i><div id='zIZgz'><tfoot id='zIZgz'></tfoot><dl id='zIZgz'><fieldset id='zIZgz'></fieldset></dl></div>
                          <legend id='zIZgz'><style id='zIZgz'><dir id='zIZgz'><q id='zIZgz'></q></dir></style></legend>