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 8464571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:47:13+00:00 2026-06-10T14:47:13+00:00

this is my ajax code: $(function(){ var cntUp = 0; var btnUpload=$(‘#upload_pdf’); var status=$(‘#status’);

  • 0

this is my ajax code:

$(function(){
    var cntUp = 0;
    var btnUpload=$('#upload_pdf');
    var status=$('#status');

    new AjaxUpload(btnUpload, {
        action: 'uplod_estimate_file.php',
        data: {saleid: $("#hid_saleid").val()},
        name: 'uploadfile_test',
        onSubmit: function(file, ext){
             if (! (ext && /^(jpg|pdf|jpeg)$/.test(ext))){ 
                // extension is not allowed 
                alert('Only JPG, PDF or JPEG files are allowed');
                return false;
            }
            this.setData({
                'saleid': $("#hid_saleid").val()
            });

            status.text('Uploading...');
        },
        onComplete: function(file, response){
            if (response.toLowerCase().indexOf("success") >= 0 ) {
                alert(response);
                /*
                var image='<img src="uploads/'+saleid+'/'+fname+'" alt=""  width="131px" height="125px"/>';
                $("#img0").html(image);*/

            }  else{
                $('<li></li>').appendTo('#files').text(file).addClass('error');
                //alert('error');
            }
        }
    });

});

this is the form:

<form name="frmvehdetails" id="frmvehdetails" method="post">

        <table cellpadding="3">
                  <tr>
            <td valign="top">VIN</td>
            <td>

                      <input class="frmIn" size="30"  name="car-vin" id="car-vin" type="text" value="" />
                      <input onclick="lookupVIN()" name="btnVin" type="button" value="Lookup" />
                      <br/>
                      <div id="vinDet" style="line-height: 20px; margin-bottom: 10px; margin-top: 10px;"></div></td>
          </tr>
                  <tr>
            <td>Year</td>
            <td><select name="car-years" id="car-years">
              </select></td>
          </tr>
                  <tr>
            <td>Make</td>
            <td><select name="car-makes" id="car-makes">
              </select></td>
          </tr>
                  <tr>
            <td>Model</td>
            <td><select name="car-models" id="car-models">
              </select></td>
          </tr>
          <tr>
            <td>Milage</td>
            <td><input type="text" name="car-milage" id="car-milage" value="" class="frmIn" /></td>
          </tr>

             <tr>
            <td>Repair Estimate</td>
            <td><input type="text" value="" id="car_estimate" name="car_estimate" class="frmIn"></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><div id="upload_pdf" style="margin-bottom:10px;" >
                  <span>Upload File</span></div></td>
          </tr>


          <tr>
            <td>Reserve Price</td>
            <td><input type="text" value="" id="car_reserve" name="car_reserve" class="frmIn"></td>
          </tr>
                  <tr>
            <td>&nbsp;</td>
            <td>
                      <input type="button"  name="sub" value="<< Previous " class="previous-product" />
                     <input type="button" id="sub" name="sub" value="Next >>" class="next-product" onclick="validatevehicle();" /></td>
          </tr> <tr>
            <td>&nbsp;</td>
             <td id="v_errmsgs" style="color:red">
           </td>
          </tr>
                </table></form>
                <input type="hidden" id="hid_saleid" name="hid_saleid" value="" />

This is the uplod_estimate_file.php:

<?php
session_start();
$sub = "";
$uploaddir = "";
if(isset($_POST['saleid'])){
    if($_POST['saleid']){
        $sub = $_POST['saleid'];
    }else{
        $sub = "";
    }
}else{
    $sub = "";
}
if($sub){
    $uploaddir = './uploads/'.$sub."/"; 
    }else{
        $uploaddir = './uploads/';
    }
$file = $uploaddir . basename($_FILES['uploadfile_test']['name']); 

if(move_uploaded_file($_FILES['uploadfile_test']['tmp_name'], $file)){
    echo "success";
}else{
    echo "error";
}


?>

But when i using this i got error undefined index ‘uploadfile_test’.How can i solve this?

  • 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-06-10T14:47:15+00:00Added an answer on June 10, 2026 at 2:47 pm

    if its problem with uppercase extension, like “PDF”, then change:

    onSubmit: function(file, ext){
       if (! (ext && /^(jpg|pdf|jpeg)$/.test(ext))){
    

    to

    onSubmit: function(file, ext){
       if (! (ext && /^(jpg|pdf|jpeg|pdf)$/i.test(ext))){ 
    

    You can add “upload_max_filesize” to .htaccess, like:

    php_value upload_max_filesize 32M
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made this bookmarklet: javascript:(function(){var s=document.createElement('script');s.setAttribute('src','http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js');document.getElementsByTagName('body')[0].appendChild(s);$('#hldIntMain').hide();$('#fadeBackground').hide();return false;})() Formatted code: // Add in jQuery var
I have this jQuery code: $(document).ready(function() { $.ajax({ url: pages/+page+.php, cache: false }).done(function( html
On document ready I run this code: jQuery(document).ready(function(){ jQuery('#button').click(function() { jQuery('#contact_form').load(/Users/mge/Downloads/jquery-ajax-1/readme.txt); return false; });
I have this code, $('.editLayout #changeLayout').click(function() { $('html').height($(document).height()); $('#fluidWrap').hide('scale'); $.ajax({ data: { mainLayout: true
Consider this code: new Ajax.Request('?service=example', { parameters : {tags : 'exceptions'}, onSuccess : this.dataReceived.bind(this)
I use this AJAX code: <script language=javascript type=text/javascript> <!-- //Browser Support Code function ajaxFunction(){
The jquery ajax code is: $(#id_btnpolls).click(function(){ var valCheckedRadio = $('input[name=data[distributions]]:checked').val(); //alert(valCheckedRadio); $.ajax({ type: POST,
I have this code: window.onload= function() { window.scrollTo(0, 0.9); if (navigator.standalone) return; for (var
Im using the below code of ajax // JavaScript Document function createTeam() { var
I was using the javascript code function ajax() { var xmlhttp; if (window.XMLHttpRequest) {

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.