Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Upload Files to Object Storage from Oracle APEX

Tanmay_ThagMar 5 2025 — edited Mar 5 2025
Hello Team , 

Wanted your help here. I am trying to upload the files from APEX to OCI object Storage Bucket, but facing HTTP error.
Can you please help me getting the correct headers for this.


----------------------------------
declare
l_request_url varchar2(32767);
l_content_length number;
l_response clob;
upload_failed_exception exception;
l_request_object blob;
l_request_filename varchar2(500);

begin
select blob_content, filename into l_request_object, l_request_filename from apex_application_temp_files where name :P2_FILE;
l_request_url:= :G_BASE_URL || '/b/'||:P2 BUCKET_NAME||'/o/' || apex_util.url_encode(l_request_filename);
apex_web_service.g_request_headers(1).name := 'Authorization';
apex_web_service.g_request_headers(1).value := 'OCI Native Authentication'; ---here what to provide
apex_web_service.g_request_headers(2).name := 'Content-Length';
apex_web_service.g_request_headers(2).value := 128;

l_response := apex_web_service.make_rest_request(
p_url => l_request_url,
P_http_method => 'PUT',
P_body_blob => l_request_object,
P_credential_static_id => 'OCI_API_Access');
end;

--------------------------------------

the Above code is not giving any errors but also not working. I followed the Youtube lession also.

Can you please help
@saipriya-thirvakadu-oracle

This post has been answered by Tanmay_Thag on Mar 10 2025
Jump to Answer
Comments
Post Details
Added on Mar 5 2025
3 comments
809 views