I'm unable to get the file(s) in question to read with file_exists(), fread(), or probably any similar function. I've tried it with .txt, .flv, .pdf, .mov, .mp3, and .wmv. I've tried removing the following from my .htaccess file to no avail.
I've also tried adding the following to my .htaccess file, which was also unsuccessful.
I know that the files themselves are error-free and the correct URL is being delivered.
Here's the relevant code from my .php file:
[PHP]
$yy = date('Y', $created);
$mm = date('m', $created);
$dd = date('d', $created);
$yymmdd = $yy.$mm.$dd;
$flv = base_path() . 'files/sundays/' . $yy . '/' . $mm . '/' . $yymmdd . '.flv';
if (file_exists($f lv)) {
// my code
} else {
echo '<p>file ' . $flv . ' doesn\'t exist.</p>'; }
var_dump(file_e xists($test));
echo '<br />';
fread($test, 8);[/PHP]
The last three lines are for testing purposes. And they're failing. :-)
Any help would be greatly appreciated. Thank you!
David
P.S. I'm using Drupal, and this is a node template. I hope that's not the problem, but just FYI.
Code:
<FilesMatch "\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$"> Order allow,deny </FilesMatch>
Code:
AddType text/plain txt
Here's the relevant code from my .php file:
[PHP]
$yy = date('Y', $created);
$mm = date('m', $created);
$dd = date('d', $created);
$yymmdd = $yy.$mm.$dd;
$flv = base_path() . 'files/sundays/' . $yy . '/' . $mm . '/' . $yymmdd . '.flv';
if (file_exists($f lv)) {
// my code
} else {
echo '<p>file ' . $flv . ' doesn\'t exist.</p>'; }
var_dump(file_e xists($test));
echo '<br />';
fread($test, 8);[/PHP]
The last three lines are for testing purposes. And they're failing. :-)
Any help would be greatly appreciated. Thank you!
David
P.S. I'm using Drupal, and this is a node template. I hope that's not the problem, but just FYI.
Comment