Upload Attachment for Mail-Form

Hello Guys,
i am new to kirby and i am working on an Contactform for Jobapplications on my Companys Website. I used the Plugin Phpmailer to send the Mails and this is working fine. The thing is in the moment, that i want to send also an attachment which the user uploads over the form.

this is the input:

<input name="myFile" type="file" required>

i know i have to upload the file, but thats the thing i have problems with. i know that kirby has an upload class, but this thing doenst worked for me. Had anyone the same problems or knows an other way to upload files ?

$upload = new Upload(__DIR__ . DS . 'uploads' . DS . '{safeFilename}', array(
  'input'     => 'myFile',
  'overwrite' => true

Maybe this thread can help: Send emails using PHPMailer

And here a solution using the Uniform plugin: Contact form with phpmailer + Uniform

Thanks :slight_smile:

i know these two posts. My Form is working quite well, its just that kirby doesnt upload any files and i want to figure out, how i use the upload class correctly. Maybe uploading doesnt work on localhost with Mamp? I didnt find any forum posts, which is handeling the upload class.

There are some posts that deal with the Upload class: