I am getting the error that the fold permissions are incorrect.
What should be the correct permissions for the Documents folder.
I set it to 777 and then tried 666 and then 755. The owner is www-data as you can see from the screenshot.
I tried changing the permission at the file level and I still can’t update the file. I ran the Sha-1 validations and it came back clean.
However, files that have been uploaded after the migration works fine but files that were migrated cannot be accessed. Even though they have the same file permissions.
What am I possibly missing? @sjpadgett @MatthewVita
here is an example of what I am talking about
FaxSample.pdf was brought over in the migration notice date.
All the files with dates in March the names can be changed updated. The FaxSample.pdf cannot and the owner and permissions are identical as far as I can tell. They were then I changed the FaxSample.pdf to 666.
Figured it out. The file location changed when I migrated the code. So, I had to update the URL in the documents table.
I used this script to update the table.
<?php
require_once('globals');
$sql = "SELECT id, url FROM documents ORDER BY id LIMIT 1";
$res = sqlStatement($sql);
while($rows = sqlFetchArray($res)){
$find = $rows['url'];
echo $rows['url'] . "<br>";
$in = str_replace("www/openemr", "www/html/openemr", $find);
echo $rows['id'] . " - " . $in . "<br>";
$id = $rows['id'];
if($find != $in) {
$sql = "UPDATE documents SET url = ? WHERE documents.id = ?";
sqlStatement($sql, array($in,$id));
} else {
echo "skipped";
}
}
1 Like