File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -380,14 +380,23 @@ public function save() {
380380 $ resp ["token " ] = null ;
381381 }
382382
383+ $ callbackParams = array ("token " => $ resp ["token " ]);
383384 try {
384385 $ uploader = SimpleUploader::createUploader ($ resp ["provider " ]);
385386 $ uploader ->initialize ($ resp ["upload_url " ], $ resp ["token " ]);
386387 $ uploader ->upload ($ this ->_source , $ this ->getMimeType (), $ key );
388+ $ callbackParams ["result " ] = false ;
387389 } catch (\Exception $ ex ) {
388- $ this -> destroy () ;
390+ $ callbackParams [ " result " ] = false ;
389391 throw $ ex ;
392+ } finally {
393+ try {
394+ Client::post ("/fileCallback " , $ callbackParams );
395+ } catch (\Exception $ ex ) {
396+ error_log ("Request /fileCallback failed. " );
397+ }
390398 }
399+
391400 forEach (array ("upload_url " , "token " ) as $ k ) {
392401 if (isset ($ resp [$ k ])) {
393402 unset($ resp [$ k ]);
You can’t perform that action at this time.
0 commit comments