Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7076869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:21:04+00:00 2026-05-28T06:21:04+00:00

I have a problem with crossdomain.xml that is located on Facebook photo servers. The

  • 0

I have a problem with crossdomain.xml that is located on Facebook photo servers. The first problem arises when Silverlight asks for clientaccesspolicy.xml – Facebook servers return 403 – Access Denied which is fine, since they also have crossdomain.xml deployed on their servers. Silverlight then asks for that crossdomain.xml and the response it gets is exactly this:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain- policy.dtd">
<cross-domain-policy>
    <allow-access-from domain="*" secure="false" to-ports="*" />
    <site-control permitted-cross-domain-policies="master-only" />
</cross-domain-policy>

Then I played for a while with this, deployed that crossdomain.xml to my own servers and a got the same results – a security exception. Then I started moving things out and came to a conclusion that everything will work as desired if I only remove the to-ports=”*” attribute? Does anyone has an idea how to overcome this, has anyone had the same problem before or is it something that I’m doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:21:04+00:00Added an answer on May 28, 2026 at 6:21 am

    I have run into the same issue while trying to programmatically retrieve images from Facebook. The strange part is that if you point a Silverlight image control to the Facebook image url, the image is retrieved and displayed without error. This got me thinking and I have come up with a viable workaround that seems to work consistently for my situation. I hope you find it useful too.

    var uri = new Uri("http://graph.facebook.com/mglace/picture/", UriKind.Absolute);
    var bmp = new BitmapImage();
    
    bmp.ImageOpened += (sender, e) => { /* Do something here with the sender (which is the BitmapImage) */ };
    bmp.CreateOptions = BitmapCreateOptions.None;
    bmp.UriSource = uri;
    

    Create a BitmapImage object, set an event handler for the ImageOpened event and set the CreateOptions property to BitmapCreateOptions.None. Finally, set the UriSource to the Facebook image you want to retrieve. The image is downloaded immediately because we set the CreateOptions to None (the default value is DelayedCreation). You can then perform any actions you would like in the ImageOpened event handler.

    I wanted to encapsulate this logic in my service layer and beef up the error handling and such so I wrapped it in a Reactive Extensions observable to make it easier to use. Here is my final code snippet:

    public IObservable<BitmapImage> GetProfilePhoto(string profileId)
    {
        return Observable.Create<BitmapImage>(
            observer =>
                {
                    // This handler handles a successful fetch
                    EventHandler<RoutedEventArgs> openedHandler =
                        (sender, args) =>
                            {
                                try
                                {
                                    observer.OnNext(sender as BitmapImage);
                                    observer.OnCompleted();
                                }
                                catch (Exception ex)
                                {
                                    observer.OnError(ex);
                                }
                            };
    
                    // This handler handle a failure
                    EventHandler<ExceptionRoutedEventArgs> failedHandler =
                        (sender, args) => observer.OnError(args.ErrorException);
    
                    var url = string.Format("http://graph.facebook.com/{0}/picture/", profileId);
                    var uri = new Uri(url, UriKind.Absolute);
    
                    BitmapImage bmp = null;
    
                    try
                    {
    
                        Deployment.Current.Dispatcher.BeginInvoke(
                            () =>
                                {
                                    bmp = new BitmapImage();
    
                                    bmp.ImageOpened += openedHandler;
                                    bmp.ImageFailed += failedHandler;
    
                                    bmp.CreateOptions = BitmapCreateOptions.None;
                                    bmp.UriSource = uri;
                                });
                    }
                    catch (Exception ex)
                    {
                        observer.OnError(ex);
                    }
    
                    return () =>
                                {
                                    // Cleanup the event handlers
                                    if (bmp != null)
                                    {
                                        bmp.ImageOpened -= openedHandler;
                                        bmp.ImageFailed -= failedHandler;
                                    }
                                };
                });
    }
    

    And usage:

    GetProfilePhoto("mglace")
        .Subscribe(image => { /* Do something with the image in here*/  },
                   error => { /* Handle any errors in here */ },
                   () => { /* Finalization code goes here */ });
    

    I hope someone out there finds this useful.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I encounter this problem : I have a django (python) server that serve XML
The problem I have a page with a silverlight object. It attempts to retrieve
I have problem with accessing Facebook graph. I am using a Greasemonkey script. When
Problem: Customer X has requested that pages using XML DataBinding and Databound tables in
I have a problem with WebRequest in Silverlight 4. In method ReadCallback at request.EndGetResponse(result)
I have problem with http://abfoodpolicy.com/ . In IE 8 and 9 the right sidebar
I have problem with my query on C, I’m using the oci8 driver. This
I have problem with repopulating form_upload after validation. Other input fields or selectboxes are
I have problem with show or hide form in Window Form Application. I start
I have problem with UIWebView delay when the load image from url. In my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.