diff --git a/ctools.module b/ctools.module
index 008214e..2986fc7 100644
--- a/ctools.module
+++ b/ctools.module
@@ -626,7 +626,12 @@ function ctools_registry_files_alter(&$files, $indexed_modules) {
 function ctools_form_comment_form_alter(&$form, &$form_state) {
   if (!empty($form_state['ctools comment alter'])) {
     // Force the form to post back to wherever we are.
-    $form['#action'] = url($_GET['q'], array('fragment' => 'comment-form'));
+    // But only do it on initialization as if the form is doing ajax file
+    // upload.
+    if (!isset($form_state['ctools_action_alter'])) {
+      $form_state['ctools_action_alter'] = url($_GET['q'], array('fragment' => 'comment-form'));
+    }
+    $form['#action'] = $form_state['ctools_action_alter'];
     if (empty($form['#submit'])) {
       $form['#submit'] = array('comment_form_submit');
     }
