diff --git a/include/class.ticket.php b/include/class.ticket.php
index 482bafbb756298ecd7bd42ec40a4e6563ffa01b5..6bbb84fed7bfd3b846a9c8131f5379570aa10686 100644
--- a/include/class.ticket.php
+++ b/include/class.ticket.php
@@ -2224,6 +2224,11 @@ class Ticket {
         // post response - if any
         $response = null;
         if($vars['response'] && $thisstaff->canPostReply()) {
+
+            // unpack any uploaded files into vars.
+            if ($_FILES['attachments'])
+                $vars['files'] = AttachmentFile::format($_FILES['attachments']);
+
             $vars['response'] = $ticket->replaceVars($vars['response']);
             if(($response=$ticket->postReply($vars, $errors, false))) {
                 //Only state supported is closed on response
diff --git a/scp/tickets.php b/scp/tickets.php
index f28ac8e3e31a1677cceede9c867e49e204473b83..649c1c63d26102d37c1addcd905d468438508cab 100644
--- a/scp/tickets.php
+++ b/scp/tickets.php
@@ -484,9 +484,6 @@ if($_POST && !$errors):
                     $vars = $_POST;
                     $vars['uid'] = $user? $user->getId() : 0;
 
-                    if($_FILES['attachments'])
-                        $vars['files'] = AttachmentFile::format($_FILES['attachments']);
-
                     if(($ticket=Ticket::open($vars, $errors))) {
                         $msg='Ticket created successfully';
                         $_REQUEST['a']=null;