Thanks for the idea @uzegonemad – we’re likely going to add this in the new plugin version! š
We’re getting the same error on the same line, but it doesn’t seem to be related to the folder–it’s just in /wp-content/uploads/
Permissions are all good, so we’re stumped.
@greatmatter – could you please try this DEV version of EMR plugin and let me know how it works for you?
Thanks,
Alex
Thanks, Alex–no, it’s still getting the same error message:
“The uploaded file could not be moved to /wp-content/uploads/[FILENAME]. This is most likely an issue with permissions, or upload failed.”
@greatmatter – thanks for the update! Did you check the permissions?
I did check the permissions, they are all set correctly. (Not to mention that regular uploads to the same folder work just fine)
@greatmatter – thanks for confirming that the permissions are right. I suspect that in this case it could still be a problem with the ownership.
This could easily explain why new uploads work fine.
Could you please check this doc and make sure the ownership of the old files is the same as the new one?
Thanks,
Alex
Ok–figured out the issue.
In classes/replacer.php, getTargetFile() is not returning the correct path info for the destination in all cases. Sometimes, it’s returning:
/wp-content/uploads/[FILENAME]
rather than
[FULL PATH]/wp-content/uploads/[FILENAME]
As a result, it’s trying to move the file to a directory that:
1. Doesn’t/shouldn’t exist
2. Doesn’t/shouldn’t have permission to access
3. Isn’t web accessible
As a TEMPORARY and quick-and-dirty workaround, I added the following code at line 216:
// If the target file directory isn't QUITE right...
$upload_dir = wp_upload_dir()['path'];
if(substr($targetFile, 0, strlen($upload_dir)) != $upload_dir) {
$targetFile = $upload_dir . '/' . pathinfo($targetFile)['basename'];
}
This fix will likely NOT work for others–but a fix is definitely necessary.
-
This reply was modified 6 years, 10 months ago by
greatmatter.
Hey @greatmatter – we just released an update a couple of days ago, could you please check it and let us know whether it solves the problem noted by you?
Thank you,
Alex
Yeah, we installed it–it doesn’t solve the problem.