尝试使用 scriptData 时 UPLOADIFY 加载程序挂在 0%

发布于 2024-12-06 14:06:52 字数 422 浏览 2 评论 0原文

我在使用 uploadify 时发现了一个错误。当我使用 scriptData 属性将发布信息传递给脚本时,加载程序不起作用。该脚本实际上已被调用并且项目已上传,但加载程序挂在 0 % 上。当您使用多个文件时,它有时会挂在第一个文件上,有时会在 95% 上,大多数情况下会在 0% 上。

看起来文件没有上传,但实际上已经上传了。但这非常烦人,因为用户会认为他们的文件尚未上传并在屏幕上等待。我尝试通过仅使用 GET 信息并将额外变量放入 script: 属性中的实际 url 中来解决此问题。这也会导致同样的问题。一个简单的说明是,我在这个项目中使用 CodeIgniter,所以这可能是一个问题。如果这个问题得到解决,那确实会有帮助,但不知道它是否会很快发生。

我在多个浏览器上检查了这个问题并遇到了同样的问题。这里有没有人处理过这个问题。我曾经喜欢 uploadify 但我恳求开始寻找其他东西

I found a bug while using uploadify. When I user the scriptData attribute to pass post information to the script the loader does not work. The script is actually called and the items are uploaded but the loader hangs on 0 %. When you user multiple files it will hang on the first one sometimes on 95% and mostly on 0%.

It looks as tho the files arent uploaded but they are. This is very anoying though, seeing that the user will think their files arent uploaded and wait on the screen. I tried to work around this by just using GET information and putting my extra variables into the actual url in the script: attribute. This also results in the same problem. A simple note is that I am using CodeIgniter for this project so this could be a problem. It would really be helpful if this was fixed but dont know if its gonna happen any time soon.

I checked this problem on multiple browsers and have the same issue. Has anyone here dealt with this. I used to like uploadify but Im begging to start looking for something else

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

牵你手 2024-12-13 14:06:52

我也遇到了这个问题,这让我抓狂。事实证明,您用来处理上传的脚本必须输出一些内容 - 任何内容 - 在 uploadify 继续之前。因此,在您的“脚本”中,例如下面的 upload.php,使脚本的最后一行在脚本底部输出一些内容 - 即使是像 echo "done"; 这样简单的内容。这将使 uploadify 知道脚本已完成,以便可以继续。

$('#file_upload').uploadify({
      'uploader'  : '/js/jquery/uploadify/uploadify.swf',
      'script'    : '/distributed/ajax/upload.php',
      'cancelImg' : '/js/jquery/uploadify/cancel.png',
      'folder'    : '/distributed/files',
      'auto'      : true,
      'scriptData': { 'request_no':req_no  },
      'onComplete': function(evt, ID, fileObj, response, data) {
                        alert("Finished!");
                        }
                     }

   });

I had this problem, too, and it drove me crazy. It turns out that the script that you're using to handle the upload has to output something - anything - before uploadify will continue. So in your 'script', like upload.php below, make the last line of the script output something at the bottom of the script - even something simple like echo "done";. This will let uploadify know that the script is finished so it can continue.

$('#file_upload').uploadify({
      'uploader'  : '/js/jquery/uploadify/uploadify.swf',
      'script'    : '/distributed/ajax/upload.php',
      'cancelImg' : '/js/jquery/uploadify/cancel.png',
      'folder'    : '/distributed/files',
      'auto'      : true,
      'scriptData': { 'request_no':req_no  },
      'onComplete': function(evt, ID, fileObj, response, data) {
                        alert("Finished!");
                        }
                     }

   });
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文