Home Forums Scripts S3 File Uploader endpoint.php?success returns wrong format URL

This topic is: resolved

This topic contains 1 reply, has 1 voice, and was last updated by  coachmkt 2 weeks, 6 days ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #23107
    coachmkt
    Post count: 2

    tempLink and thumbnailUrl in returning JSON are in wrong format.

    They are https://s3.amazonaws.com/BUCKET/….

    It should be https://BUCKET.s3.amazonaws.com/

    Where should I edit in endpoint.php?

    I set cors to true, so it’s supposed I have to fix something in vendor/fineuploader/php-s3-server/endpoint-cors.php, is that right? But where in the file?

    #23108
    coachmkt
    Post count: 2

    I’ve already found the solution. As I use ‘s3’ and ‘CORS’, so I edit this file:-

    vendor/fineuploader/php-s3-server/endpoint-cors.php

    At line 283, change from
    $link = getTempLink($bucket, $key);
    $response = array(“tempLink” => $link);
    to
    $link = getTempLink($bucket, $key);
    $link = str_replace( “{$bucket}/”, “”, $link );
    $link = str_replace( “s3.amazonaws.com”, “{$bucket}.s3.amazonaws.com”, $link );
    $response = array(“tempLink” => $link);

    The same may apply to vendor/fineuploader/php-s3-server/endpoint.php line 257.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.