Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

cffile can't read a br tag?

Explorer ,
Mar 08, 2011 Mar 08, 2011

I'm having cffile read an html file, and it works fine every time - unless there is a <br /> within a paragraph like this:

<p>By Bob Jones<br />Media Features</p>

Doesn't make sense, but if I take out the <br />, the file gets read just fine, every time. I should mention I'm also doing an xmlparse on the file, and I believe that's where the error is occuring.

773
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 08, 2011 Mar 08, 2011

Hang on.  Is the error happening on the CFFILE call or the xmlParse() call?  You kinda suggest both, but it can be only one.

It always pays to post a replication case rather than describe the code, btw.  Knock together some simple, self-contained code that demonstrates the problem, and include the contents of a test file (again, as simple as possible).  This should have been the first of your own troubleshooting steps, btw, to isolate exactly what's causing the problem.

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 08, 2011 Mar 08, 2011

The error states the following:

An error occurred when performing a file operation read on file D:\inetpub\hellosandiego\editorial\life\backyard soirees_html\backyard soirees.html

So it looks like it's happening when cffile attempts to read the html file. The html file is nothing fancy.

There are <br /> tags all over the file, and they don't cause a problem. It's only when there it's within a paragraph, like this:

<p>By Margraret Farber<br />Media Features</p>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 08, 2011 Mar 08, 2011

I found the problem, and it had nothing to do with the file. The naming convention of the file was the problem.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 08, 2011 Mar 08, 2011

But you said if you take the BR out of the file, the problem went away?

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 08, 2011 Mar 08, 2011

Poor research on my part.

The page basically takes a zip file, unzips it (contents is an html file and supporting images), reads the html file that it just unzipped and displays the html in an online editor for my client.

I thought I'd fixed it at one point by taking out that <br />, but then that fix didn't work on subsequent tests, and I couldn't figure out why. Then I noticed the client was changing the name of the zip file before uploading it. The zip file name and the folder name have to be the same in order for the system to work. Works fine now. Sorry for the confusion.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 08, 2011 Mar 08, 2011
LATEST

Ah I see: fair enough.  We've all done that.  I last had that sort of thing happen just a coupla weeks ago.  Frustrating, innit? 😉

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources