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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:14:35+00:00 2026-06-13T18:14:35+00:00

I found some code to make a jquery upload. It almost works except I

  • 0

I found some code to make a jquery upload. It almost works except I don’t have any value in the $_FILES variable on the php file that handle the upload. Here’s the snippet

<script type="text/javascript">
$(document).ready(function () {

    $("#formsubmit").click(function () {

        var iframe = $('<iframe name="postiframe" id="postiframe" style="display: none" />');

        $("body").append(iframe);

        var form = $('#theuploadform');
        form.attr("action", "/upload.aspx");
        form.attr("method", "post");
        form.attr("enctype", "multipart/form-data");
        form.attr("encoding", "multipart/form-data");
        form.attr("target", "postiframe");
        form.attr("file", $('#userfile').val());
        form.submit();

        $("#postiframe").load(function () {
            iframeContents = $("#postiframe")[0].contentWindow.document.body.innerHTML;
            $("#textarea").html(iframeContents);
        });

        return false;

    });

});

</script>

<form id="theuploadform">
    <input id="userfile" name="userfile" size="50" type="file" />
    <input id="formsubmit" type="submit" value="Send File" />
</form>

<div id="textarea">
</div>

Does anyone know what’s going on ?

  • 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-13T18:14:38+00:00Added an answer on June 13, 2026 at 6:14 pm

    this is a header sent problem !
    to send file upload to server, you should to use FormData class in javascript/jQuery !
    I suggest use this jquery plugin to make it easy :

    jQuery ajax form

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

Sidebar

Related Questions

I have found some code which recognize circles in particular image and I was
I have found some code snippet in the internet. But it is missing some
I have found some code on measuring execution time here http://www.dreamincode.net/forums/index.php?showtopic=24685 However, it does
I have put up some code to make an ajax, php, mysql chat in
i found some code which is using anchor tags in eval eval(a='http://google.co.in'+window .location.href); The
I found some code for an rss reader. And I want to use it
I just opened a file in IDA Pro and I found some code that
I am new to vbscript and while reading i found some code as Do
I got a task to maintain a c# project, I found some code like
I found some old code which I'm not sure I understand completely. The folowing

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.