I am trying to import CFM files. (migrating from ColdFusion) I only need to bring in the contents of one DIV and it has valid HTML in it, but I've had to rename the file to HTM to get the import_html module to even look at it. I have set the default document to index.cfm, but it's not in the list. The file is in a black color (html files are blue) and the log says that "due to the suffix" it is "not an HTML page that I can process."
I realize I can walk the site and rename the files BUT - that will break my internal links. The module would be more flexible and allow more import possibilities if this wasn't happening.
Here is the message, there seems to be a funny quote in it:
I think (due to file suffix '') that 'myfile.cfm' is not a html page I can process.
And here is my DOCTYPE declaration from the head of that file:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Comments
Comment #1
dman commentedThat funny quote is a worry. That indicates that it came in with no suffix, which is what's really going on. I added the quotes in the message just so we could see when that happens.
The system uses the string file suffix, or MIME on the server, it doesn't try looking for DOCTYPE in what may be a binary file.
Not sure why it would fail to get a suffix out of your filename. Any funny characters in it?
Comment #2
dman commentedimport_html_guess_file_class()
tries to use 'finfo' or 'mime_content_type' if either are on your system.
Those systems should recognize anything that your server has registered as */html
If those are not working, then it uses pathinfo() to grab the suffix, and allows
No reason why you can't add cfm to that list (just do it), but I switched to preferring MIME functionality to avoid maintaining that fallback list at all.
Comment #3
verta commentedI added the CFM extension to the list, but it did not help the problem.
I can clarify it a bit, it's not one double quote mark, it's two single quotes, as in the mime type is coming back null from import_html_guess_file_class($filename).
I'm aware that the document does not validate as the doctype it's claiming to be, and I'm not sure what the PHP MIME libraries think of it yet. I'm not sure if I even have the proper library installed.