---
title: "Discussion on \"CKEditor5 Image Upload - Part 3\" | Hashnode"
description: "Discussion on \"CKEditor5 Image Upload - Part 3\". Use OCI Object Storage to store the images"
url: "https://hashnode.com/posts/ckeditor5-image-upload-part-3/630616cf79f56556d0cb744e"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [CKEditor5 Image Upload - Part 3](https://lmoreaux.hashnode.dev/ckeditor5-image-upload-part-3?utm_source=hashnode&utm_medium=feed)

Use OCI Object Storage to store the images

Aug 24, 2022 · 5 min read · lmoreaux.hashnode.dev  
Read the article

-   [#orclapex](https://hashnode.com/tag/orclapex)
-   [#ords](https://hashnode.com/tag/ords)
-   [#oci](https://hashnode.com/tag/oci)

## Written by

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

@lmoreaux · Paris

  
[View profile](https://hashnode.com/@lmoreaux)

Oracle APEX developer

Oracle APEX Developer (Insum) from Paris Contributor of Flows for APEX Passionate about APEX and web development.

## Responses 3

Markdown supported · ⌘↵ to post

[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.

[Nicolas Pilot](https://hashnode.com/@NPilot)

[Aug 25, 2022](https://hashnode.com/posts/ckeditor5-image-upload-part-3/630616cf79f56556d0cb744e/comment/6307159579f56556d0cb944f)

Excellent Louis, Thanks for sharing this.

Yes I think that for this case (CKEditor Image), this is the best solution (because of the simplicity).

For other use cases, with a lot of file uploads by users, we definitely need to avoid the files handling by the database and send the files directly from the browser to the cloud storage...

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

[Aug 25, 2022](https://hashnode.com/posts/ckeditor5-image-upload-part-3/630616cf79f56556d0cb744e/comment/6307159579f56556d0cb944f#reply-6307177d79f56556d0cb949c)

Thanks [Nicolas Pilot](https://hashnode.com/@NPilot)! Yes, I will maybe look some days at the custom adapter 🙂

[Jon Dixon](https://hashnode.com/@orclapex)

[Aug 24, 2022](https://hashnode.com/posts/ckeditor5-image-upload-part-3/630616cf79f56556d0cb744e/comment/63061a0cd69cbd5671587757)

Nice! This is now my reference document for APEX CKEditor image handling in the cloud.

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

[Aug 24, 2022](https://hashnode.com/posts/ckeditor5-image-upload-part-3/630616cf79f56556d0cb744e/comment/63061a0cd69cbd5671587757#reply-63062514d69cbd5671587953)

Thanks [Jon Dixon](https://hashnode.com/@orclapex) for challenging me! Really motivating 🙏
