I just realized that the following error message in a "red box" always appears at the top of contents at various pages:

Could not display the flash because does not appear to exist.

Everything is functional though, but looks like a minor bug in the code.

#49 spaces.patch1.84 KBDaRK


Whaaaaa?????! Never even heard of this before. What module are you using to actually display the Flash contents? FlashVideo does not print anything out like this. You might have a module collision.

Status:Active» Closed (fixed)

Since you say FV doesn't produce that msg in the code, then definitely its another module. Thanks for the heads up. I am debugging right now.

Turns out it was the Image module. Strange!

I dunno, but i think it's a 'flash node module' error. A conflict with the swf tools.

same here, as soon the SWFTool is switched on (only the base-module) I got this message

I realized that with FlashVideo, there's absolutely no need for SWF Tools -- which is buggy - if you only want to display videos, Flash Video by itself works great, even if you don't have FFMPEG.

Speaking of conflict with SWF Tools, I wonder if the following is the result of such a conflict:

For some reason, I cannot change the width and height of my flash video player (with FlashVideo module). I've tried changing dimension settings in both custom FlashVars and FFMPEG settings input - neither does the trick, it always stays at 425x344. All else is fully functional.

So when I looked at my HTML output, I see the following:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">
   <param name="movie" value="http://spiffyd.com/sites/default/files/player.swf" />
   <param name="FlashVars" value="file=http://MYDOMAIN.COM/PATH/TO/FLV.FLV&image=@THUMBPATH&controlbar=over&width=470&height=320&autostart=false" />
   <param name="quality" value="high" />
   <param name="wmode" value="transparent" />
         <embed allowScriptAccess="always" src="http://MYDOMAIN.COM/PATH/TO/PLAYER.SWF"
      type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"
      flashvars="file=http://MYDOMAIN.COM/PATH/TO/FLV.FLV&image=@THUMBPATH&controlbar=over&width=470&height=320&autostart=false" />

425x344 was specified between the EMBED tags! I've looked all over my FlashVideo settings and don't see any way to change this.

The reason I suggest that this may be a conflict with SWF Tools is b/c I recall previously inputting 425x344 in the JW Player Config (or some other setting) associated with the SWF Tools module. Perhaps these values did not properly get removed from the database on uninstall?

Any suggestions on how to resolve this issue much appreciated!

Project:FlashVideo» SWF Tools
Version:6.x-1.4-beta» 5.x-2.2
Status:Closed (fixed)» Active

Updating SWF tools from 5.x-2.1 to 5.x-2.2

(with Flash Node 5.x-5.4 updated to 5.x-5.5)

Could not display the flash because "files/http://mysite.com/files/flash/myflash.flv" does not appear to exist.

as you see, flash files are in files/flash directory.

http://drupal.org/node/297337 not of help...
Also http://drupal.org/node/243343 not of help too, because when importing a new file (via ftp), the node is created but shows the same message.

when reverting to 5.x-2.1 (and Flash Node 5.x-5.4), everything works back fine.

Any suggestions ?

Can you confirm what you are trying to do - play back an flv you uploaded via flash node? Playback an flv from an swf filter?

The problem looks to be an extra 'files' at the start of the file path.

thanks Stuart for your swiftness, the answer is...

- play back flv already uploaded via flash node prior the upgrading to both swf 5.x-2.2 & flashnode 5.x-5.5

But after upgrading, when trying to upload, flash node imports the file but says the same in the node:

Could not display the flash because "files/http://mysite.com/files/flash/myflash.flv" does not appear to exist.

Are you saying that existing content plays, but that new content doesn't, and you get this error when uploading new files?

Or do you get this error for all content, both things you created before upgrading and those you created after?

I'm getting this error for all content, both things I created before upgrading and those I created after.

  • existing contents do not play = "not exist", in fact they're still in the same place file/flash, the node is published - so, right- "does not appear to exist"
  • new content uploaded, published but node is empty (same message... "Could not display...")

So I get the message for any content, before and after upgrading.

Title:"Could not display the flash because does not appear to exist." bug"Could not display the flash because does not appear to exist."

I can't create this error locally. There aren't that many changes between each version of flash node / SWF Tools.

You can "mix and match" between flash node 5.x-5.4/5.5 and SWF Tools 5.x-2.1/2.2. So can you try flash node 5.x-5.5 with SWF Tools 5.x-2.1, and flash node 5.x-5.4 with SWF Tools 5.x-2.2 to see if any of those combinations work, or fail.

That might help determine if it's something about flash node, or something about SWF Tools that is causing the hiccup. That said, all combinations appear to be working here.

I've also tried with both public and private file systems in case that is the issue, but again all working fine.

I'm seeing the same issue creating new FLV nodes with SWF Tools 6.x-1.3 and Flash Node 6.x-2.2 on Drupal 6.4. I can't test with existing content (because I've just installed these modules).

Flash Node is passing the right values to swf(), but somewhere inside swf() or in something called from swf(), there seems to be a broken reference. I also notice that, though the file reference gets lost, the file directory path remains.

Switching off "Check if local files exist" lets me grab the following embeding code from FlowPlayer, which has the file directory path (but no file) showing up:
<embed src="http://localhost:8888/FAST/sites/all/modules/swftools/shared/flowplayer/FlowPlayerClassic.swf?config=%7Bembedded%3Atrue%2CbaseURL%3A%27http%3A%2F%2Flocalhost%3A8888%2FFAST%2Fsites%2Fall%2Fmodules%2Fswftools%2Fshared%2Fflowplayer%27%2CvideoFile%3A%27http%3A%2F%2Flocalhost%3A8888%2FFAST%2Ffiles%2F%27%7D" width="960" height="720" scale="noscale" bgcolor="111111" type="application/x-shockwave-flash" allowFullScreen="true" allowScriptAccess="always" allowNetworking="all" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>

I had no luck tracking down the broken reference, but I'm completely unfamiliar with the code. Let me know if you need more information or if you have any hints on where I might look to find where a) SWF tools checks if local files exist, and b) flowplayer gets its value for videoFile.

This is really strange - I just tested with my local set up (Drupal 6.4 / SWF Tools 6.x-1.2 / Flash node 6.x-2.2) and it's ok! I tried with Wijering 4 and FlowPlayer just in case it was player specific.

What also puzzles me is that the code posted in #13 doesn't actually look like SWF Tools code. The embed src has all the config parameters attached in a query string after the ?, but SWF Tools uses flash vars to pass the data, and there is no flash vars string set. A lot of the other SWF Tools parameters also seem to be missing (no setting for quality, no setting for base, while allowNetworking isn't a parameter that normally gets passed at all!

What embedding method are you using?!

To help with debugging in SWF Tools 6.x-1.2 add the following between lines 340 and 341 of swftools.module:

drupal_set_message('File is '.$file);

In SWF Tools 5.x-2.2 the same code, but between 309 and 310.

That will cause a message to output when the flash node is rendered and it will give you the file path.

If you are using the latest flash node you should see a fully formed url that is the path to the file (the flv file, not the media player).

E.g. on my test set up I get http://localhost/drupal6/files/flash/test.flv

In SWF Tools 5.x-2.2, putting the code [drupal_set_message('File is '.$file);] in line 310, gave me the correct location url of the file.
Viewing the node:

File is http://mysite.com/files/flash/myflash.flv

Could not display the flash because "files/http://mysite.com/files/flash/myflash.flv" does not appear to exist.


Great (kind of). That says that flash node is working properly since it supposed to provide a full path to SWF Tools. So it's SWF Tools that is getting a bit confused and for some reason is trying to validate an already valid path. That explains the extra 'files' when you see the message.

So at least I know where to try and start debugging, although like I said, it is working ok for me already!

but, Stuart, as an answer to your post # 12:

flash node 5.x-5.4 with SWF Tools 5.x-2.2.... works !!

but not flash node 5.x-5.5 with SWF Tools 5.x-2.1

Just to be clear:

Flashnode 5.x-5.4 and SWF Tools 5.x-2.2 = Works

Flashnode 5.x-5.5 and SWF Tools 5.x-2.1 = Doesn't Work

Flashnode 5.x-5.5 and SWF Tools 5.x-2.2 = Doesn't Work


Looks like I'm going to be busy this evening!

To clarify, the code I posted is the embed code generated by flowplayer when I select embed from its built-in menu. I just posted it to show that it was getting the files directory path but not the FLV file's path.

@marantz - I'm still not sure what you are referring to! Is the code sample you posted "live" code from your page that isn't working, or code from somewhere else?

Can you post the mark up that is actually being produced by the SWF Tools / flash node combination - thanks.

<div class="swftools-wrapper flowplayer-mediaplayer"><div class="swftools">
<object width="960" height="720" id="swf12235780081" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<param value="http://localhost:8888/FAST/sites/all/modules/swftools/shared/flowplayer/FlowPlayerClassic.swf" name="movie"/>
<param value="sameDomain" name="allowScriptAccess"/>
<param value="opaque" name="wmode"/>
<param value="#FFFFFF" name="bgcolor"/>
<param value="showall" name="scale"/>
<param value="autohigh" name="quality"/>
<param value="l" name="align"/>
<param value="true" name="allowfullscreen"/>
<param value="http://localhost:8888/FAST/files/" name="base"/>
<param value="true" name="play"/>
<param value="false" name="menu"/>
<param value="true" name="loop"/>
<param value="player=flowplayer/FlowPlayerClassic.swf&amp;width=960&amp;height=720&amp;config=%7B%20%27videoFile%27:%20%27http://localhost:8888/FAST/files/%27%20%7D&amp;videoFile=http://localhost:8888/FAST/files/" name="flashvars"/>
<!--[if gte IE 7]>-->
<object width="960" height="720" data="http://localhost:8888/FAST/sites/all/modules/swftools/shared/flowplayer/FlowPlayerClassic.swf" type="application/x-shockwave-flash">
<param value="sameDomain" name="allowScriptAccess"/>
<param value="opaque" name="wmode"/>
<param value="#FFFFFF" name="bgcolor"/>
<param value="showall" name="scale"/>
<param value="autohigh" name="quality"/>
<param value="l" name="align"/>
<param value="true" name="allowfullscreen"/>
<param value="http://localhost:8888/FAST/files/" name="base"/>
<param value="true" name="play"/>
<param value="false" name="menu"/>
<param value="true" name="loop"/>
<param value="player=flowplayer/FlowPlayerClassic.swf&amp;width=960&amp;height=720&amp;config=%7B%20%27videoFile%27:%20%27http://localhost:8888/FAST/files/%27%20%7D&amp;videoFile=http://localhost:8888/FAST/files/" name="flashvars"/>
<p>You are missing some Flash content that should appear here! Perhaps your browser cannot display it, or maybe it did not initialise correctly.</p>
<!--[if gte IE 7]>-->

There's the code straight from the page. The previous code was from clicking in the lower right corner of the flowplayer box and selecting "Embed." from the menu that pops up. Sorry about the confusion on where that came from.


I think I can see what is happening, but not why!

First, can you try adding this debug line immediately after the line you added in the previous test...

drupal_set_message(valid_url($file, true) ? 'Valid url' : 'Not a valid url');

I suspect you are going to see 'Not a valid url' but can you confirm.

The upshot is that if SWF Tools doesn't think the url it receives is valid then it assumes it has been given a reference to a file, so it adds a reference to the file path, hence the extra 'files'.

In flash node 5.x-5.5 the code that calls SWF Tools was changed from sending a partial path to a complete path in order to ensure it worked properly with some other SWF Tools settings.

This shouldn't matter, and it works for me here. If SWF Tools gets a full path it skips any checks (or at least it should). If I simulate locally that the full path is invalid then I get the extra 'files' too - the behaviour you are seeing.

But I don't understand why your set up doesn't interpret the path correctly - SWF Tools just calls the built in valid_url function. In fact, the path itself is built by another Drupal function, file_create_url!

I will need to test some more to try and work out why this is test is failing as it's the only thing I can see that is the issue, particularly as the first debug test showed that flash node sent a proper path!


A sudden thought - does the filename of the file you are trying to show contain any 'special' characters - e.g. spaces, apostrophes. Looking more closely at the functions, and testing locally, if I upload a file with a name like My movie.flv (note the space) then it works under flash node 5.x-5.4, but not 5.x-5.5.

Aha! That cured it for me. I had a space in my test file's name. When I rename it to remove spaces and re-upload it works.

(However, I have the feeling, before too long, I'll be running into other members of our staff uploading files with spaces because it works everywhere else.)

@marantz - thanks for posting so quickly as this confirms the issue I think. I have now tested using filenames with spaces and can create this issue.

The reason I wasn't getting the error at first is because I've been running tests locally with private file handling. With that enabled the spaces in the filename get properly encoded and everything works. If I change to public handling, and switch off the checks for local files, then I get exactly the results that you have found.

I am just thinking around the best way to fix it. There are a few places where the filenames get encoded so I need to find the "right" way to do it so the encoding doesn't get encoded...

In the meantime, avoid using filenames with spaces!

OK - part I of a fix is done - this mends flash node so that if you happen to use a filename with a space, and you are using public downloads, then any spaces are encoded as %20, and then flash node works properly with SWF Tools.

I have quickly tested locally flv, swf and m3 against public and private downloads, using each player, and the combinations seem to be working.

Part II of the fix will need some work in SWF Tools to handle file names that have spaces in coming from the input filter, but that's for another day.

The flash node fixes are available from flash node CVS branches DRUPAL-5--3 for flash node 5, and from HEAD for flash node 6, if you don't mind testing them!

hi all,

i found an alternative solution for this.I have just modified the coding in the swftools.module file.

just include the media url coding as given below:

function swftools_get_media_url($path, $is_file = TRUE) {

$media_url = trim(variable_get('swftools_media_url', ''));
$media_url = "sites/default/files" ;
// We do nothing with a remote media file.
if ($media_url) {
return $media_url . '/' . $path;
if (variable_get('swftools_check_media', TRUE) && $is_file) {
if (file_exists($path)) {
return file_create_url($path);
else {
drupal_set_message(t('Could not display the flash because %path does not appear to exist.', array('%path' => $path)), 'error');
return FALSE;

I am sure this will work fine.


Version:5.x-2.2» 6.x-2.2

i am getting the same problem in d6.10, with all the swf shared items loaded.

I am also getting this same problem in d6.10, with a file with no spaces in it.

Same problem but resolved :

at the message error : "Could not display the flash because does not appear to exist."

I rewrite the full url path within the <swf> tag from <swf file="/mydirectory/sites/default/files/audio/Some-Skunk-Funk.mp3">


<swf file="http://www.mysite.net/mydirectory/sites/default/files/audio/Some-Skunk-Funk.mp3">

may be it could help...

I am having this problem no matter which player I use, with a file whose path is absolutely correct. All read permissions are open, etc.

<object type="application/x-shockwave-flash" data="http://mysite.net/sites/all/modules/swftools/shared/generic/generic_mp3.swf" width="30" height="31">
<param name="allowScriptAccess" value="sameDomain" />
<param name="wmode"             value="opaque" />
<param name="bgcolor"           value="#FFFFFF" />
<param name="scale"             value="showall" />
<param name="quality"           value="autohigh" />
<param name="align"             value="l" />
<param name="allowfullscreen"   value="false" />
<param name="base"              value="http://mysite.net/sites/default/files/" />
<param name="play"              value="true" />
<param name="menu"              value="false" />
<param name="loop"              value="false" />
<param name="flashvars"  value="file_url=http://mysite.net/sites/default/files/podcasts/MyFile.mp3&amp;autostart=false" />

Three players load up just fine (1pixelOut, generic, JW Media Player 4), all report in their various ways that this file does not exist. It looks like only the generic player, shown above, sticks the "&autostart=false" on the end of the file path. The 1PixelOut player renders:
<param name="flashvars"  value="autostart=yes&amp;loop=no&amp;soundFile=http://mysite.net/sites/default/files/podcasts/MyFile.mp3" />

I also have the node show the file link for downloading. That path is completely correct, and clicking returns "page not found" while trying to do the download (right-click->save link as) simply fails silently.

Drupal 6.10
SWF Tools 6.x-2.4

Maybe fixed with -dev or 2.5????? Maybe, since link is correct, there is something in File Upload that is foobaring the actual file data?

Why when in Firefox 3.0.11, besides my flash content also show this

"<!--[if gte IE 7]>--> <!--<![endif]-->"
You are missing some Flash content that should appear here! Perhaps your browser cannot display it, or maybe it did not initialize correctly.
<!--[if gte IE 7]>--> <!--<![endif]-->"

but in IE it odesn't show up

what's wrong, I use SWFTools 6.x-2.5 (direct embedding) and my themes is waffles?

Version:6.x-2.2» 6.x-2.5

Try to embed the code into another node. If the messages "Could not display the flash because does not appear to exist." doesn't appears there - then there is an easy way - works for me:
Delete the node where the message appears and create a new one with the same content.
Then the message doesn't appears again. Works for me with drupal 6.14 and SWF Tools 6.x-2.5

I'm experiencing this bug too.
I can't believe that it exists since August 19, 2008 and has not been corrected yet.

For me (SWFTools 2.5) using jw player 4 , the video filepath got picked up from the field. However I had a harder time putting in the preview image. Here's the code :

$video_url =  $video_node->field_media_object_source[0]['filepath'];
$thumbnail_url = imagecache_create_path('video_preview',$video_node->field_media_object_thumb[0]['filepath']);
$jw_player_thumbnail_url = str_replace('sites/'.$_SERVER['HTTP_HOST'].'/files', '', $thumbnail_url);

these than get sent to the node template where they are used within print swf(...,...)

For my case, I recently upgraded my Drupal with security patch 6.15 (original 6.14) and then all SWFTools not working with a message "Could not display the flash because .......".

With Firebug, I found this one "swfobject.embedSWF("http://localhost/drupal-6.14/http://localhost/drupal-6.14/sites/all/modu...". Obviously site name duplicated.
Then in "admin/settings/swftools/embed" (i.e. SWFTools >>> Embedding settings), I found that
"SWFObject 2 - JavaScript" was enabled.
Instead, I enabled
"Direct embedding - do not use JavaScript replacement"
Then the SWFTools players all work again.

Hope this might help some of you.

I experienced this issue today. I managed to solve it by changing:

[swf file="/sites/example.swf"]


[swf file="sites/example.swf"]


There is a problem in 6.x-2.5 that will cause files starting with a / to not work.

This is addressed in 6.x-3.x which will properly handle a local path in that format.

@Stuart, thanks for the info, though I need to ask you if is there any chance to release a 2.x with this issue fixed? I usually refrain from using -beta version on production sites, and a fixed 2.x would be nice. Not a big deal though as we are already aware of this bug and have the workaround.

The 3.x release is THAT close to being ready that I don't plan a 2.x first as 3.x will follow so closely behind.

If you are ok with working around yourself for now that's brilliant.

The 3.x release is going to be awesome (well, I think so). Performance is dramatically improved, and there are lots of great new features to play with.

I reckon one week, maybe two, before 6.x-3.x arrives...

Status:Active» Needs review

Setting to needs review as I think this issue is addressed in 6.x-3.x which is due soon.

The fix is in place in BETA4 and DRUPAL-6--3. I won't go back and fix 6.x-2.x at this time as 6.x-3.x will replace that shortly.

I tried Beta4 and that is when i first encountered this error. I'm switch back to the 6.x-2.5 version since I can not fix it with the above info. NOTE: If you provide a fix, please provide location of file and line number to apply fix to.

Thanks Stuart, it was just right a path problem in my case :)

I actually solved this one by enabling clean urls. Firebug revealed the swf file trying to play from a location without the /?q=

Any updates on this issue, it seems like files with spaces are not being handled correctly with 6.x-2.5 as well.


Hey I was having the same issue... found that changing permissions to 777 on the files/flash directory or doing a chown to www-data solved the problem, not sure why... but i decided to go with the second option as i'd rather not 777 the directory

#46's comments still valid - spaces in filenames not working.

Version:6.x-2.5» 6.x-3.0-beta4
new1.84 KB

after a bit of debugging, tracked down the issue to be with valid_url() failing when the url has specialchars like spaces in swftools_get_url_and_path()

The main change being urlencoding the path before running valid_url.
Also for filepath, its was just removing the base_path(), added a case for when the base_path is just /.

function swftools_get_url_and_path($file) {
  $filepath = parse_url($file, PHP_URL_PATH);
  $fileurl = str_replace($filepath, drupal_urlencode($filepath), $file);
  // src will contain a full, or relative, url that is used to render the file
  // src_path will contain a partial path (without webroot), or the original file path
  $ret = array(
    'fileurl' => '',
    'filepath' => $file,
  // If already a valid absolute url simply return it
  if (valid_url($fileurl, TRUE)) {
    $ret['fileurl'] = $file;
    return $ret;
  // If a valid url, and starts with /, then assume to be a local path relative to web root
  // No security check is needed as the result of this is only output to the webpage
  // We strip base_path from the file to create filepath that is valid for image_get_info later.
  if (valid_url($fileurl) && strpos($file, '/') === 0) {
    return array(
      'fileurl' => $file,
      'filepath' => base_path() == '/' ? substr($file,1) : str_replace(base_path(), '', $file),
  // If defintely in the local file system return a relative url to the file
  if ($file == file_create_path($file)) {
    // If media checking is active check to see if it actually exists
    if (variable_get('swftools_check_media', TRUE)) {
      // If the file doesn't exist, set an error message and return FALSE to indicate failure
      if (!file_exists($file)) {
        drupal_set_message(t('SWF Tools could not find %file.', array('%file' => $file)), 'error');
        return FALSE;
    // If we got here then return a relative url to the file
    $ret['fileurl'] = swftools_create_url($file);
    return $ret;
  // Retrieve the media url setting
  $media_url = trim(variable_get('swftools_media_url', ''));
  // If a remote path is set build the appropriate url to the file
  if ($media_url) {
    $ret['fileurl'] = $media_url . '/' . $path;
    return $ret;
  // If we got here then expand to a local file path and call again
  return swftools_get_url_and_path(file_create_path($file));

Attached a patch which also includes the fix for php 5.3 compatibility.

flv files do not work with spaces. #49 appears to fix the problem.

In my case, I was using a field that stored the path and filename of the SWF file, which was then used in the tpl file with the swf($filename) command. I had stupidly set a default value for this field, thinking it would be easier for the client to not have to remember the whole path. So, of course, when the client didn't need a video, they just ignored the field, leaving the default value there. This then caused swftools to not find the file and throw out that error. Stupid problem, I know, but maybe someone else made the same mistake, so I'm posting here just in case.

I just discovered that I have the same exact problem with our website with audio files and SWF Tools 6.x-2.5, but only on IE / Windows 7. It works on all other browser (e.g. Firefox). The file path swf($path, $args) is an absolute URL to an external file. There are no spaces in the file name (e.g. 008.mp3). The only 'special' character is an underscore in a folder name as part of the URL. I get the "You are missing some Flash content ..." message if I leave away the arguments swf($path) and get a square with the red cross if I leave the arguments in. Does anyone know if #47 works and if I have to change the permissions on the innermost folder?

Is there a patch for 6.x-2.5 similar to #49? I've just run into the same issue after upgrading some modules.

I have the same problem. can you help me? How to fix it?
Thank you,

Why on earth is this a user message anyway? It should be a watchdog event.