diff --git a/lib/NGCP/Panel/Role/API/SoundFiles.pm b/lib/NGCP/Panel/Role/API/SoundFiles.pm index 48bb381fac..6af87a0a33 100644 --- a/lib/NGCP/Panel/Role/API/SoundFiles.pm +++ b/lib/NGCP/Panel/Role/API/SoundFiles.pm @@ -24,7 +24,9 @@ sub transcode_data { $resource->{data} = NGCP::Panel::Utils::Sounds::transcode_file( $filename, uc($from_codec), $resource->{codec}, ); + unlink($filename); } catch($e) { + unlink($filename); $c->log->error("failed to transcode file: $e"); $self->error($c, HTTP_UNPROCESSABLE_ENTITY, "Failed to transcode file"); return;