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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:58:56+00:00 2026-06-14T01:58:56+00:00

i have a problem with my php fileupload which im using via ajax in

  • 0

i have a problem with my php fileupload which im using via ajax in jquery.

This is my code in the php upload file:

if ($_FILES["file"]["error"] > 0)
{
    echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
} else {
    move_uploaded_file($_FILES["file"]["tmp_name"],"termine.csv");
    echo "Stored in: " . $_FILES["file"]["name"];
}

This is my jquery ajax statement:

 $('#upload_csv').click( function() {
    $.ajax({
        url: '/playground/php/updatedates.php',
        type: 'POST',
        data: $('form#csv').serialize(),
    }).done(function(txt) {
            if(txt!='')alert(txt);
    });
});

and this is my form in the index.php file:

<form enctype="multipart/form-data" id="csv" method="POST">
            <div style="float:left">
            <input name="file" type="file" id="file" size="100">
            <br/>
            <input type="submit" id="upload_csv" value="upload csv file">
            </div>
        </form>

The only error message i get is “error” and nothing else.

Hope somebody can help.

  • 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-14T01:58:57+00:00Added an answer on June 14, 2026 at 1:58 am

    $().serialize always creates a url-encoded string, and ignores file input. You have to use another approach. See: http://api.jquery.com/serialize/

    One option is to put the form in a hidden iframe and trigger the submit event.

    Also take a look at the jQuery File Upload plugin: http://blueimp.github.com/jQuery-File-Upload/

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

Sidebar

Related Questions

I'm coding a form using PHP and jQuery. I have a file upload field
I am trying to upload a pdf file using fileupload() function in php. This
i have problem.. for(a=1;a<10;a++){ $(.div).append(<div id=+a+></div>) $.ajax({ url: file.php, data: a=+a, type: POST, async:
I have a file upload system which, in PHP, limits to 20 files at
I'm using uploadify (a jQuery uploading) script, which has basically a PHP file at
I am doing file upload async with jquery/php using the target attribute of a
I have a problem with php file upload, so..when I try to uploads some
i have problem on my php file upload script , i am trying to
Consider a normal PHP image upload functionality (not using AJAX) and there occurs this
I have a problem in php code inserting values into database (I use PHPMyAdmin).

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.