From 10cfd55f1b1708c5a3f742a1520563422440387d Mon Sep 17 00:00:00 2001 From: Jordan Clark Date: Mon, 3 Jun 2024 18:18:23 -0500 Subject: [PATCH] Update for no asyncManager async doesn't exist outside of coldbox so this ensures it won't try to split uploads and then fail when asyncManager is undefined. --- models/AmazonS3.cfc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/models/AmazonS3.cfc b/models/AmazonS3.cfc index 58363dc..97bd768 100644 --- a/models/AmazonS3.cfc +++ b/models/AmazonS3.cfc @@ -800,7 +800,12 @@ component accessors="true" singleton { arguments.contentType = getFileMimeType( arguments.filepath ); } - var byteCount = getFileInfo( arguments.filepath ).size; + var byteCount = 0; + if( structKeyExists( variables, "asyncManager" ) ) { + // if these is an asyncManager then check the file size + // outside of coldbox there is no asyncManager so this would fall apart + byteCount = getFileInfo( arguments.filepath ).size; + } if ( byteCount <= variables.multiPartByteThreshold ) { arguments.data = fileReadBinary( arguments.filepath );