Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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>
Copy link to clipboard
Copied
I found the problem, and it had nothing to do with the file. The naming convention of the file was the problem.
Copy link to clipboard
Copied
But you said if you take the BR out of the file, the problem went away?
--
Adam
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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