Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6323669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:33:41+00:00 2026-05-24T16:33:41+00:00

How can I live’ify my jquery (form plugin) upload routine as described below? The

  • 0

How can I “live’ify” my jquery (form plugin) upload routine as described below?

The first click uploads and refreshes the list as expected, but the user cannot upload a second file as it seems no to be firing the javascript, I have tried several “.live(‘submit'” combinations with this plugin but haven’t solved:

JQuery uses the form plugin:

$(document).ready(function() {   
var options = {target: '#uploads_panel', 

                 data:
                     { upload_ajax_on:'1',
                               upload:'1'
                     }
              };

$('#upload-form').submit(function() {
    $(this).ajaxSubmit(options);
     return false;
});
});

form looks like this:

 <div id='uploads_panel'> <!-- for ajax refresh -->
    //table containing existing file list
<form action="/file/upload" method="post" id="upload-form" enctype="multipart/form-data">
    <p>File<br />
    <input type="file" name="userfile" id="userfile" /></p>
    <p><input type="submit" value="Submit" /></p>
</form>
</div>

and the controller looks like this:

public function uploadAction()
{

//fetch variables etc

if(isset($_POST['upload']))
{
$data=array();
$data[name] = $_FILES['userfile']['name'];
$data[internal_name] = date("Y-m-d-h-m-s",time()).$data[name];
$data[type] = $_FILES['userfile']['type'];
$data[size] = $_FILES['userfile']['size'];
$data[path] = 'uploads/'. $_SESSION['customer_id'] . "/".$data[internal_name];
$data[upload_time] = time();
$data[user_id] = $_SESSION['user_id'];
$data[customer_id] = $_SESSION['customer_id'];

$tmpName = $_FILES['userfile']['tmp_name'];

$testervar=$uploadDir.$data[internal_name];
$result = move_uploaded_file($tmpName, $uploadDir.$data[internal_name]);

if (!$result)
{
    echo "Error uploading file";
    die;
}

$db = new DBitems();
 //   $last_id=$db->uploadFile($data);


}

$upload_ajax_on=$_POST['upload_ajax_on'];

$dbitems = new DBitems();
$filelist=$dbitems->selectFilesByCustomerId($_SESSION['customer_id']);
$this->registry->template->filelist =$filelist;


if(isset($upload_ajax_on))
{
$this->registry->template->setView('masterpage','layouts:ajax');
$this->registry->template->setView('contents','customers:table_upload');
}
else
{
$returnurl=$_POST['returnurl'];
$this->registry->router->redirect($returnurl);
}


}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T16:33:42+00:00Added an answer on May 24, 2026 at 4:33 pm

    Have you tried moving the form outside the uploads_panel div? Not sure if that is being affected by the update or not? Hope that helps?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how can i disable live('click', function...) method and then after ajax call (depending on
Is the .Net 4 Framework going to change before the go-live or can we
Can I stream a live video in WPF application from my web cam? If
Free as in beer. I can live without the source code. About 10 years
I'd like to protect some audio files I'm streaming. I can live without being
Hi I'm writing a psudo-terminal that can live in a tty and spawn a
I know I can live without it, but the question's been bugging me. Is
Can somebody point me to a resource that explains how to go about having
Can anyone (maybe an XSL-fan?) help me find any advantages with handling presentation of
Can you cast a List<int> to List<string> somehow? I know I could loop through

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.