The issue with some images not appearing on firefox/chrome/ie is very easy to reproduce and within 5 minutes i've been able to figure out whats going on - this issue should not be happening and it should require a pretty simple fix on your end.
Essentially what is happening is the server is actually returning HTML instead of images, the contents of that HTML is "Please do not link directly to this resource. You must have a session in the forum." That tells me a few things.
What causes that
1. You are probably on a very old version of YAF, not recommended and probably a security risk. Your forum should be upgraded to the latest version.
2. Potentially your IIS server is configured to reject multiple that are quick and fast to a specific URL - this is most likely not the case.
3. YAF is having trouble with requests and the subsequent URL referrer sent with Chrome/Firefox/IE for images - This is the MOST LIKELY culprit. It could be that the YAF software isn't responding properly to the requests, or IIS has some configuration issue handling referrers. I can't replicate the issue in Safari 5.1.7.
Quick Fix:
1. in resource.ashx change
Code:
public void ProcessRequest( HttpContext context )
{
// resource no longer works with dynamic compile...
if ( context.Request.QueryString ["r"] != null )
{
// resource request
GetResource( context );
}
else if(context.Request.UrlReferrer.Host.Equals(context.Request.Url.Host, StringComparison.InvariantCultureIgnoreCase)) //if ( context.Session ["lastvisit"] != null )
{
if ( context.Request.QueryString ["u"] != null )
{
GetResponseLocalAvatar( context );
}
else if ( context.Request.QueryString ["url"] != null && context.Request.QueryString ["width"] != null && context.Request.QueryString ["height"] != null )
{
GetResponseRemoteAvatar( context );
}
else if ( context.Request.QueryString ["a"] != null )
{
GetResponseAttachment( context );
}
else if ( context.Request.QueryString ["c"] != null && context.Session ["CaptchaImageText"] != null )
{
// captcha
GetResponseCaptcha( context );
}
else if ( context.Request.QueryString ["s"] != null && context.Request.QueryString ["lang"] != null )
{
GetResponseGoogleSpell( context );
}
}
else
{
// they don't have a session...
context.Response.Write("Please do not link directly to this resource. You must have a session in the forum.");
}
}
TO
Code:
public void ProcessRequest( HttpContext context )
{
// resource no longer works with dynamic compile...
if ( context.Request.QueryString ["r"] != null )
{
// resource request
GetResource( context );
}
else if ( context.Request.QueryString ["a"] != null )
{
GetResponseAttachment( context );
}
else if(context.Request.UrlReferrer.Host.Equals(context.Request.Url.Host, StringComparison.InvariantCultureIgnoreCase)) //if ( context.Session ["lastvisit"] != null )
{
if ( context.Request.QueryString ["u"] != null )
{
GetResponseLocalAvatar( context );
}
else if ( context.Request.QueryString ["url"] != null && context.Request.QueryString ["width"] != null && context.Request.QueryString ["height"] != null )
{
GetResponseRemoteAvatar( context );
}
else if ( context.Request.QueryString ["c"] != null && context.Session ["CaptchaImageText"] != null )
{
// captcha
GetResponseCaptcha( context );
}
else if ( context.Request.QueryString ["s"] != null && context.Request.QueryString ["lang"] != null )
{
GetResponseGoogleSpell( context );
}
}
else
{
// they don't have a session...
context.Response.Write("Please do not link directly to this resource. You must have a session in the forum.");
}
}
This moves the processing of attachments outside of the URL referrer check. Also you can follow instructions here that will completely remove all referrer checks:
http://www.yetanotherfor...sts/t8027-resource-ashx
Please see what you can do about fixing this error. not being able to see uploaded files is extremely annoying and impedes our ability to effectively share ideas and images. Feel free to have your team email me with questions.
-todd