uploadify with prettyPhoto:uncaught exception:调用StartUpload失败
我们一直在使用uploadify进行图片上传,使用prettyPhoto在我们的Rails应用程序中在lightbox上显示图像。 如果单独使用,两者都很好。 现在我们想在dropbox上显示uploadify控件,就像dropbox一样,但如果与prettyPhoto一起使用它会开始尖叫。
这是使用uploadify和prettyPhoto的示例html。
My Uploadify Implementation $(function() { $('#file_upload').uploadify({ 'swf' : 'uploadify.swf', 'uploader' : 'uploadify.php' // Your options here }); $('#closeme').live('click', function() { $.prettyPhoto.close(); return false; }); $("a[rel^='prettyPhoto']").prettyPhoto(); }); popop This is inline content opened in prettyPhoto.
在这里,您将看到弹出窗口的链接,点击链接,它会在灯箱上显示uploadify控件。 然后,您从磁盘中选择图像以上载到服务器。 选择图像后,我面临两个问题:
1)获取Error: uncaught exception: Call to StartUpload failed
在FF和Crome上Error: uncaught exception: Call to StartUpload failed
javascript错误
2)所选图像未在灯箱上的uploadify控件上列出。 如果您关闭pupup并再次单击弹出链接,则会显示文件列表。
如果我删除$("a[rel^='prettyPhoto']").prettyPhoto();
线。
你知道如何解决这个问题吗?
如果有人建议其他插件来实现这种Dropbox风格的上传者,我将不胜感激。
谢谢,阿米特帕特尔
您需要在灯箱打开后初始化uploadify,而不是在页面加载时。 原因是因为如果隐藏元素,Flash将不会加载。
我查看了prettyPhoto api,找不到灯箱打开后调用的任何事件,但这就是你需要做的事情。