---
title: "Comment by Yuji Nakakoshi on \"CKEditor5 Image Upload - Part 3\" | Hashnode"
description: "Thank you very much, Louis. I followed your instruction and add some changes. In ORDS POST hander, return Object Storage URL instead of ORDS GET URL. Get pre au"
url: "https://hashnode.com/posts/ckeditor5-image-upload-part-3/630616cf79f56556d0cb744e/comment/630956c538843b7139783ea5"
---

[Discussion](https://hashnode.com/posts/ckeditor5-image-upload-part-3/630616cf79f56556d0cb744e)

Comment [CKEditor5 Image Upload - Part 3](https://hashnode.com/posts/ckeditor5-image-upload-part-3/630616cf79f56556d0cb744e)

[Yuji Nakakoshi](https://hashnode.com/@ynakakoshi)

[Aug 26, 2022](https://hashnode.com/posts/ckeditor5-image-upload-part-3/630616cf79f56556d0cb744e/comment/630956c538843b7139783ea5)

Thank you very much, Louis. I followed your instruction and add some changes.

1.  In ORDS POST hander, return Object Storage URL instead of ORDS GET URL.
2.  Get pre authenticated request URL just after APEX session is authenticated and store it in Application Item. (by Application Computation)

```
declare
    l_response dbms_cloud_oci_obs_object_storage_create_preauthenticated_request_response_t;
    l_result   dbms_cloud_oci_object_storage_preauthenticated_request_t;
    l_details dbms_cloud_oci_object_storage_create_preauthenticated_request_details_t;
    l_url varchar2(4000);
    preauth_request_error exception;
begin
    l_details := dbms_cloud_oci_object_storage_create_preauthenticated_request_details_t;
    l_details.name := 'standard-' || sys_guid();
    l_details.bucket_listing_action := 'Deny';
    l_details.object_name := null;
    l_details.access_type := 'AnyObjectRead';
    l_details.time_expires := systimestamp + interval '1' day;
    l_response := dbms_cloud_oci_obs_object_storage.create_preauthenticated_request (
        namespace_name => :G_NAMESPACE
        , bucket_name => :G_BUCKET
        , create_preauthenticated_request_details => l_details
        , region => :G_REGION
        , credential_name => :G_CREDENTIAL
    );
    if l_response.status_code != 200 then
        raise preauth_request_error;
    end if;
    l_result := l_response.response_body;
    l_url := 'objectstorage.& || :G_REGION || '.oraclecloud.com' || l_result.access_uri;
    return l_url;
end;
```

1.  Replace the image URL to Pre authenticated URL within editingDowncat.

```
                    if ( data.attributeNewValue ) {
                        if ( data.attributeNewValue.startsWith("&G_OBJECT_STORAGE_URL.")) {
                            data.attributeNewValue = data.attributeNewValue.replace("&G_OBJECT_STORAGE_URL.","&G_PREAUTH_URL.");
                        }
                    }
```

I hope you find it interesting.

[Louis Moreaux](https://hashnode.com/@lmoreaux)

[Aug 29, 2022](https://hashnode.com/posts/ckeditor5-image-upload-part-3/630616cf79f56556d0cb744e/comment/630956c538843b7139783ea5#reply-630c692043d7308e3e3259f3)

Hi Yuji, This is amazing, thanks for sharing it here. I will definitely dig deeper into pre-authenticated requests because it seems like the perfect solution for this use case.
