Mobile Marketing Blog

We are working on a project for a client that has a very troublesome requirement as part of the custom content management system—the ability to enter ANY image URL into an HTML text field for use within a custom Flash application that we built.

This is troublesome because although the client does own the rights to the images they are using, they do not have any easy way to implement crossdomain.xml policy files on their image servers.

SO, we needed to come up with a workaround—hence the example below. Please keep in mind that this is just an example and the version optimized for other image types/videos/error checking/etc. is not posted.


<?php

// GET THE PATH OF THE TARGET IMAGE
if (isset($_GET["img"])) {

    // READ THE CONTENTS OF THE IMAGE
    $handle = fopen($_GET["img"], "rb");
    $contents = "";
    while (!feof($handle)) {
        $contents .= fread($handle, 8192);
    }
    fclose($handle);

    // DISPLAY THE IMAGE
    header ("Content-Type: image/jpeg");
    echo $contents;
}

?>


Comments

  1. June 22nd, 2008 at 12:50 | #2

    I read your PHP Tutorial – Bypass the Need for a Cross Domain Policy File When Loading Images in Flash. I am running ubunta 8.04 as a newbie.Things are going well except for the crossdomain flash. I cant write programs but I am finding that I can go fetch what I need and then copy and paste. Do you have a command that I can use by pasting into the terminal.

    thanks

    steven
  1. No trackbacks yet.

Brand Experience

Pearson
intel
Allstate
Liquid Wrench
Qualcomm
ups
ASPCA
Motel 6

Punchkick Interactive in the news

Facebook Connect on iPhone Stops Connecting; Connect’s Login UX Drops “Connecting” Language
—October 27, 2010,

If you haven’t noticed yet within your apps, the login screen for Facebook Connect has updated to feel more “iPhone friendly,” and Facebook has dropped this idea of “connecting” as a result. Additionally, there are many cues in the new UX which assume an experienced Facebook user, which seems like a shift in Facebook’s approach [...]

Punchkick Interactive and Keathley Advertising Team Up to Create GE Mood Lighting Cam iPhone App
—June 5, 2010,

Punchkick Interactive, a Chicago-based mobile marketing company, and Keathley Advertising, an Akron-based advertising agency, today announced the launch of the GE Mood Lighting Cam iPhone app.

Junior Interactive Designer
—June 30, 2011,

General Qualifications: Represent the company while interfacing with clients, vendors, and colleagues. Demonstrate raw talent, willingness to take initiative, act independently, and work effectively within a professional environment with a polished and intellectually strong presence. Exercise good judgment, have superior people skills and excellent oral and written communication abilities. Basic Qualifications: 1 – 2 years [...]