Skip to content

Uploaded file not deleted - "Directory not empty" #1714

@realflash

Description

@realflash

Current CPAN version of Dancer2 1.1.0
Running under Strawberry Perl (64-bit) Portable 5.38.2.2-64bit on Windows 11

Here's the handler:

post '/ingest' => sub {
   my $file = request->upload('uploaded_file');
   $log->debug("Uploaded file saved to ".$file->tempname);
   return template 'uploaded';;
};

Here's the result:

C:\Users\****\dev\pcnm_windows>.\run_dev.bat
Watching lib ****\bin\app.psgi for file updates.
2024/07/02 10:59:41 TRACE Built config from files: C:\Users\*****\config.yml C:\Users\****\environments\development.yml
HTTP::Server::PSGI: Accepting connections at http://0:5000/
2024/07/02 10:59:47 TRACE looking for post /ingest
2024/07/02 10:59:47 TRACE Entering hook core.app.before_request
2024/07/02 10:59:47 DEBUG Uploaded file saved to C:\Users\****\AppData\Local\Temp\Beq0v\qjP4TSSqP0
2024/07/02 10:59:47 TRACE Entering hook core.app.after_request
127.0.0.1 - - [02/Jul/2024:10:59:47 +0100] "POST /ingest HTTP/1.1" 200 8116 "http://localhost:5000/ingest" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
cannot remove directory for C:/Users/****/AppData/Local/Temp/Beq0v: Directory not empty at C:/Users/****/dev/pcnm_windows/dist/perl/perl/lib/File/Temp.pm line 2643.

The file is not deleted, and I assume it is meant to be though that is not clear from the POD for this class.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions