Developer issue
-
Hey,
I have just installed the plugin and encountered this issue when trying to import existing wordpress media to S3 and I have solved it.
I just wanna know if its only happened on me.
My issue is like this:
I tried whatever send file to S3 (single) or the migration tools Sync for the existing file.
I knew both of them are calling push_to_s3
I checked the path is incorrect.
Precisely, I wanna give this example.
$localFile = “/var/www/html/live/wp-content/uploads/var/www/html/live/wp-content/uploads/2015/09/hello.pdf”;
$remoteFile = “/wp-content/uploads/var/www/html/live/wp-content/uploads/2015/09/hello.pdf”Obviously the path is not correct because the root path looks like duplicated.
I have dig down a little bit I found that the keys that passing to push_to_s3 is like
/var/www/html/live/wp-content/uploads/2015/09/hello.pdfand key will be appended directly as the path pointing to the local file or constructed as the S3 directory path.
My fix is just
adding line
$key = str_replace($this->uploads[“basedir”],””,$key);
on top of$localFile = $this->sanitize_s3_path($this->uploads[“basedir”] . “/” . $key);
Anyway, it would be nice if someone can explain to me why would that happened to my instance
- The topic ‘Developer issue’ is closed to new replies.