Uploadify SWF请求页面加载网址 [英] Uploadify swf requesting URL on page load

查看:262
本文介绍了Uploadify SWF请求页面加载网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Uploadify在Asp.net网站,页面的网址是/资源/创建/ ID,但在页面加载uploadify似乎正以根URL的请求该网页/资源/创建/

这是造成服务器错误,因为没有ID提供,并填补了我的日志,没有人知道它可以请求,如果它可以被设置为不要求这个网址。这里是我的JS:

  VAR ID = $('#文件上传')ATTR(数据ID)。
$('#文件上传')。uploadify({
  SWF':'/Scripts/Libraries/uploadify/uploadify.swf',
  '上传':'/资源/上传/+ ID
})


解决方案

我已经解决了按照在此线程尤金的评论这个问题,

<一个href=\"http://www.uploadify.com/forum/#/discussion/7329/uploadify-v3-bug-unecessary-request-when-there-is-no-button_image_url-set-/p1\">http://www.uploadify.com/forum/#/discussion/7329/uploadify-v3-bug-unecessary-request-when-there-is-no-button_image_url-set-/p1


  

查找以下中的文件的上部code:


  
  

this.settings.upload_url =
  SWFUpload.completeURL(this.settings.upload_url); this.settings.button_image_url
  = SWFUpload.completeURL(this.settings.button_image_url)


  
  

和它改写为:


  
  

this.settings.upload_url =
  SWFUpload.completeURL(this.settings.upload_url); this.settings.button_image_url
  = this.settings.button_image_url? SWFUpload.completeURL(this.settings.button_image_url):
  this.settings.button_image_url


I am using Uploadify on a Asp.net site, the url for the page is /Resource/Create/id, but on page load uploadify appears to be making a request to the root url of that page /Resource/Create/

This is causing a server errors because no id is supplied and filling up my logs, does anyone know what it could be requesting and if it can be set to not request this url. Here is my JS:

var id = $('#fileUpload').attr('data-id');
$('#fileUpload').uploadify({
  'swf': '/Scripts/Libraries/uploadify/uploadify.swf',
  'uploader': '/Resource/Upload/' + id
})

解决方案

I have resolved this issue by following eugen's comment on this thread,

http://www.uploadify.com/forum/#/discussion/7329/uploadify-v3-bug-unecessary-request-when-there-is-no-button_image_url-set-/p1

Find following code in the upper part of the file:

this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url);this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url)

and rewrite it to:

this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url);this.settings.button_image_url = this.settings.button_image_url ? SWFUpload.completeURL(this.settings.button_image_url) : this.settings.button_image_url

这篇关于Uploadify SWF请求页面加载网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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