*

A.M

  • ***
  • 34 posts
Amazon S3 and the mail images issue need to solve
« on: January 05, 2023, 06:23:44 AM »
Hello everyone...

we have an issue about Amazon S3, the images when the user got daily mails not showing!, that's how it looks:



When I traced the source of the problem, i found the link of the Thumbnail looks like this:

https://domainname.s3.amazonaws.com/oc-content/uploads/4/13_thumbnail.jpg,

when i delete: oc-content/uploads/4/

and it become after that:

https://domainname.s3.amazonaws.com/13_thumbnail.jpg

it's work, but hoooooow to delete oc-content/uploads/4/, where the file location which it's responsible for that,

and how to delete it without affecting other properties,

does anyone have an idea?,

please if you have any idea, share it with me,

thank you
« Last Edit: January 05, 2023, 06:26:04 AM by A.M »
iloveOsclass

*

MB Themes

Re: Amazon S3 and the mail images issue need to solve
« Reply #1 on: January 05, 2023, 01:18:47 PM »
Do you use that amazon s3 plugin (free?). Though it does not work...
Url with oc-includes looks corect.
What urls you have on listing page/search page?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

A.M

  • ***
  • 34 posts
Re: Amazon S3 and the mail images issue need to solve
« Reply #2 on: January 05, 2023, 07:22:13 PM »
Do you use that amazon s3 plugin (free?). Though it does not work...
Url with oc-includes looks corect.
What urls you have on listing page/search page?

yes i use it, is work very perfect with me, only need small update, with this issue, and everything will be ok :)
iloveOsclass

*

A.M

  • ***
  • 34 posts
Re: Amazon S3 and the mail images issue need to solve
« Reply #3 on: January 05, 2023, 07:28:20 PM »
Do you use that amazon s3 plugin (free?). Though it does not work...
Url with oc-includes looks corect.
What urls you have on listing page/search page?

What urls you have on listing page/search page?
the url looks like the example up, this for daily mails,

it's work here: listing page/search page

but i'ts not showing here:

-Instant Messenger Plugin, in the messages
-is not showing in the mails, when user get daily mail, the photo not showing


note: this photo in the attachment not real photo, only example from this link:

https://osclasspoint.com/osclass-plugins/messaging-and-communication/instant-messenger-plugin-i50#lg=1&slide=5
« Last Edit: January 05, 2023, 09:07:34 PM by A.M »
iloveOsclass

*

MB Themes

Re: Amazon S3 and the mail images issue need to solve
« Reply #4 on: January 05, 2023, 09:07:49 PM »
Does not make much sense now what you are telling...
Is url wrong or not?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

A.M

  • ***
  • 34 posts
Re: Amazon S3 and the mail images issue need to solve
« Reply #5 on: January 05, 2023, 09:31:53 PM »
Does not make much sense now what you are telling...
Is url wrong or not?

i will answer again,

everything is work without anyproblem, except:

-Instant Messenger Plugin, in the messages.
-is not showing in the mails, when user get daily mail, the photo not showing.

iloveOsclass

*

A.M

  • ***
  • 34 posts
Re: Amazon S3 and the mail images issue need to solve
« Reply #6 on: January 06, 2023, 08:59:14 AM »
Does not make much sense now what you are telling...
Is url wrong or not?

sorry i forget to tell you also that is not working in Listings >>> Manage media also

iloveOsclass

*

MB Themes

Re: Amazon S3 and the mail images issue need to solve
« Reply #7 on: January 06, 2023, 11:28:14 AM »
Ok send 1 url of functional image and one i.e. from Media page.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

A.M

  • ***
  • 34 posts
iloveOsclass

*

A.M

  • ***
  • 34 posts
Re: Amazon S3 and the mail images issue need to solve
« Reply #9 on: January 07, 2023, 12:54:50 AM »
Ok send 1 url of functional image and one i.e. from Media page.

what you think?, i hope wwe get update for this plugin soon :)
iloveOsclass

*

MB Themes

Re: Amazon S3 and the mail images issue need to solve
« Reply #10 on: January 07, 2023, 11:51:44 AM »
Still not getting what is correct URL and what is wrong (which one works for you and which one does not).
Then we can check if bug has plugin or osclass.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

A.M

  • ***
  • 34 posts
Re: Amazon S3 and the mail images issue need to solve
« Reply #11 on: January 08, 2023, 01:56:12 AM »
Still not getting what is correct URL and what is wrong (which one works for you and which one does not).
Then we can check if bug has plugin or osclass.

https://domainname.s3.amazonaws.com/oc-content/uploads/3/2172_thumbnail.jpg <<< is display this, but this not work,

so you need to remove this: oc-content/uploads/3/ from the link to be able work directly, and that issue in:

-Cpanel >>> Listings >>> Manage media
-Instant Messenger Plugin
-daily mails

if you the developer, we can talk in private so i can shere with you the private info, but i can't do it in Public

Regards
iloveOsclass

*

MB Themes

Re: Amazon S3 and the mail images issue need to solve
« Reply #12 on: January 09, 2023, 03:51:56 PM »
@AM
This is what is used in Media table in backoffice:
Code: [Select]
<img src="' . osc_apply_filter('resource_path', osc_base_url() . $aRow['s_path']) . $aRow['pk_i_id'] . '_thumbnail.' . $aRow['s_extension'] . '" width="60" height="50"/>
So plugin have to use resource_path filter and update path.

In plugin I see:
Code: [Select]
function amazon_resource_path($path) {
  if(osc_get_preference('bucket', 'amazons3') <> '') {
    return "https://". osc_get_preference('bucket', 'amazons3') .".s3.amazonaws.com/" . str_replace(osc_base_url().osc_resource_field("s_path"), '', $path);
  }
 
  return $path;
}

osc_add_filter('resource_path', 'amazon_resource_path');

Important code:
Code: [Select]
str_replace(osc_base_url().osc_resource_field("s_path"), '', $path)
and also (bucket must be set):
Code: [Select]
if(osc_get_preference('bucket', 'amazons3') <> '') {
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

A.M

  • ***
  • 34 posts
Re: Amazon S3 and the mail images issue need to solve
« Reply #13 on: January 10, 2023, 05:03:07 AM »
@AM
This is what is used in Media table in backoffice:
Code: [Select]
<img src="' . osc_apply_filter('resource_path', osc_base_url() . $aRow['s_path']) . $aRow['pk_i_id'] . '_thumbnail.' . $aRow['s_extension'] . '" width="60" height="50"/>
So plugin have to use resource_path filter and update path.

In plugin I see:
Code: [Select]
function amazon_resource_path($path) {
  if(osc_get_preference('bucket', 'amazons3') <> '') {
    return "https://". osc_get_preference('bucket', 'amazons3') .".s3.amazonaws.com/" . str_replace(osc_base_url().osc_resource_field("s_path"), '', $path);
  }
 
  return $path;
}

osc_add_filter('resource_path', 'amazon_resource_path');

Important code:
Code: [Select]
str_replace(osc_base_url().osc_resource_field("s_path"), '', $path)
and also (bucket must be set):
Code: [Select]
if(osc_get_preference('bucket', 'amazons3') <> '') {

Maaaaaaaaaaaaaan, you make my day :D

yes it's work,

1- i replaced this:

Code: [Select]
<img src="' . osc_apply_filter('resource_path', osc_base_url() . $aRow['s_path']) . $aRow['pk_i_id'] . '_thumbnail.' . $aRow['s_extension'] . '" width="60" height="50"/>
with this:

Code: [Select]
<div class="img-wrap"><img src="' . osc_apply_filter('resource_path', osc_base_url() . $aRow['pk_i_id']) . '_thumbnail.' . $aRow['s_extension'] . '" width="60" height="50"/>
and boooom it's work :D

and about aws plugin look no any wrong in it, the problems in the code of mails and Instant Messenger Plugin

i tried to replace this code in Instant Messenger Plugin:

Code: [Select]
<?php echo osc_apply_filter('resource_path'osc_base_url() . $item['pk_i_id']) . '_thumbnail.' $aRow['s_extension']; ?>, but unfortunetly not work :(

i hope you can find solution for this, but thank you very much for your help:

now 1/3 has been fixed:

-Cpanel >>> Listings >>> Manage media ✔️
-Instant Messenger Plugin
-daily mails im not sure if it work or not, i wait one mail and will tell you,

« Last Edit: January 10, 2023, 08:26:54 AM by A.M »
iloveOsclass

*

MB Themes

Re: Amazon S3 and the mail images issue need to solve
« Reply #14 on: January 10, 2023, 11:08:24 AM »
I think it will only work when osc_resource() is available and that's your issue here.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots