I have been trying to upload a .swf file using Flash Node but everytime it gives the error: not a valid flash file. I believe I have followed all the steps carefully as far as installation is concerned, including the download of the ufo files etc. I know the .swf file is ok because I can play it as a movie without any problem. I have tried Flash Node on both windows and linux servers but to no avail.

Arindam Ghatak
www.MyResearchFunds.com

Comments

arindamghatak794’s picture

Ok, so this is very strange. I used mozilla firefox to upload flash files and I got this "Not a valid flash file" message. But when I tried doing the same thing using IE, it worked fine. Very strange indeed.

Stuart Greenfield’s picture

This sounds like the mime type that is being reported is not what flashnode is expecting. When this happens then as well as displaying an error message on the form a message is placed in the event log.

It will read as "'flash was given type for upload." where type is the mime type that the module detected. Flash node will reject the upload if it isn't application/x-shockwave-flash.

Can you look in your log, see what type has been recorded and post again with the type. This will help diagnose what is happening and may suggest a solution.

Thanks.

arindamghatak794’s picture

Title: Not a valid flash file » Not a valid flash format

Well I looked at the log to see whats going wrong but the it just says:
flashfile May 25 2007 - 2:43pm flash was given for upload. admin

And the detailed report is:

Type	flashfile
Date	Friday, May 25, 2007 - 2:43pm
User	admin
Location	http://www.coolsimulations.com/node/add/flash
Referrer	http://www.coolsimulations.com/node/add/flash
Message	flash was given for upload.
Severity	notice
arindamghatak794’s picture

I am not sure there is anything wrong with the flash files because it works fine in IE. The problem might lie either with the firefox browser or maybe the flashnode module might need to detect the browser and give some browser specific command.

Stuart Greenfield’s picture

If you are seeing just "flash was given for upload" then this means that the upload hasn't reported a mime-type at all. It should be identified as application/x-shockwave-flash, which is the correct mime-type. A blank means it isn't being reported as anything! You might want to try re-installing the flash plug-in for firefox (Adobe download page).

Flashnode looks for this mime-type in the supplied upload to see that it has been given flash.

If you browse to a webpage containing flash using Firefox does it display the flash ok? (e.g. my home page is currently displaying flash in the lead item)

Once on the page can you try Tools > Page Info > Media and check what mime-type is being reported for the .swf file and post back.

Flashnode shouldn't need to do anything browser specific since flash content is determined by mime-type (as per this Adobe technote). I have managed to upload under IE, Opera and Firefox, and on both Win and Linux platforms. I just tested under Firefox again and it's working here.

As a "work around" you could disable the mime-test code by deleting this whole block from flash_prepare in the module (starts at line 214):

      // ...check if the mime type wasn't flash
      if (strtolower($file->filemime) != 'application/x-shockwave-flash') {
        watchdog($field_name,t('flash was given %type for upload.', array('%type' => $node->file->filemime)));
        form_set_error($field_name, t('The specified file is not a valid Flash format.'));

        // delete the uploaded file in case it is unsafe
        file_delete($file->filepath);
        return;
      }

but that only fixes the symptom and doesn't help us understand and fix the root cause.

Thanks!

Stuart

arindamghatak794’s picture

Thanks for the snippet, it works...but then as you said, it just takes care of the symptom rather than the problem. I have flash plugins installed. I know this because I can play flash movies/files on both mozilla and IE without any problems. But there might be something wrong with my individual settings of mozilla that might be causing problems....I am not sure what that is. It isn't a problem with the module though I think.

Arindam
www.MyResearchFunds.com

Stuart Greenfield’s picture

Status: Active » Closed (fixed)

Changing to closed as the source of the problem isn't known. Will re-open this thread if the problem occurs for other users.

trantt’s picture

"I am not sure there is anything wrong with the flash files because it works fine in IE"
I'm using IE7 and FireFox 2.0.0.3 and experiencing the same problem.

gdw2’s picture

Version: 4.7.x-1.1 » 5.x-3.0
Priority: Normal » Minor

I had the same problem and the only way to get around it was diabling the mime check also.