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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:11:12+00:00 2026-05-27T18:11:12+00:00

After testing AjaxFileUpload Plugin I discovered that it does not let me retrieve $_POST

  • 0

After testing AjaxFileUpload Plugin I discovered that it does not let me retrieve $_POST data, as the plugin only submits $_FILE data. Therefore I turn to jQuery Form Plugin which is documented here: http://www.malsup.com/jquery/form/#file-upload

Unfortunately, I feel the example is poor and doesn’t really help me. I need to use IFrame in order to prevent the page to reload.

Does anyone have some working code og link to god tutorials using jQuery Form plugin for uploading files using IFrame?

I know there are other file upload plugins, but I would like to use this one for this project.

UPDATE
This is the code I currently use. All it does is relaod the page and I get no output / alerts.

HTML

<form id="uploadForm" enctype="multipart/form-data" action=""  method="POST">
    <input type="hidden" name="MAX_FILE_SIZE" value="1000000" />
    <input type="hidden" id="current_path" name="current_path" value="<?php echo $fb->relative_url; ?>" />
    <input id="uploadFile" name="uploadFile" type="file" />
    <input type="submit" class="button uploadImage" value="<?php _e('Upload File') ?>" /> <br /> 
</form>

Javascript

var options = {
    beforeSubmit:   function() { alert('before');},
    success:        function(html) { alert('success + ' + html);},
    data:           {current_path: jQuery('#currentPath span').html()},
    url:            '../wp-content/plugins/wp-filebrowser/uploader.php',
    iframe:         true,
    dataType:       'html'
};

jQuery('#uploadForm').submit(function() {
    jQuery(this).ajaxSubmit(options);
    return false;
});

I also tried this JS

jQuery('#uploadForm').ajaxForm({
    beforeSubmit:   function() { alert('before');},
    success:        function(html) { alert('success + ' + html);},
    data:           {current_path: jQuery('#currentPath span').html()},
    url:            '../wp-content/plugins/wp-filebrowser/uploader.php',
    dataType:       'html'
});

But still my page only reloads and no alerts are fired 🙁

DEBUG

Running the following script in my JS file: alert(jQuery('#uploadForm').ajaxForm); gave me this output:

function (options) {
    if (this.length === 0) {
        var o = {s: this.selector, c: this.context};
        if (!jQuery.isReady && o.s) {
            log("DOM not ready, queuing ajaxForm");
            jQuery(function () {jQuery(o.s, o.c).ajaxForm(options);});
            return this;
        }
        log("terminating; zero elements found by selector" + (jQuery.isReady ? "" : " (DOM not ready)"));
        return this;
    }
    return this.ajaxFormUnbind().bind("submit.form-plugin", function (e) {if (!e.isDefaultPrevented()) {e.preventDefault();
jQuery(this).ajaxSubmit(options);}}).bind("click.form-plugin", function (e) {var target = e.target;
var jQueryel = jQuery(target);
if (!jQueryel.is(":submit,input:image")) {var t = jQueryel.closest(":submit");
if (t.length == 0) {return;}target = t[0];}var form = this;
form.clk = target;
if (target.type == "image") {if (e.offsetX != undefined) {form.clk_x = e.offsetX;
form.clk_y = e.offsetY;} else if (typeof jQuery.fn.offset == "function") {var offset = jQueryel.offset();
form.clk_x = e.pageX - offset.left;
form.clk_y = e.pageY - offset.top;} else {form.clk_x = e.pageX - target.offsetLeft;form.clk_y = e.pageY - target.offsetTop;}}setTimeout(function () {form.clk = form.clk_x = form.clk_y = null;}, 100);});
}

From the debugging, it looks like the form is not finished loading when I run this script. That’s weird, because I have it inside jQuery(document).ready().

  • 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-27T18:11:12+00:00Added an answer on May 27, 2026 at 6:11 pm

    I ended up using Uploadify.

    To get this code working, I use the following script:

      /*  Brand logo uploadify
      -----------------------------------------------------------------------------*/    
      function uploadifyBrandLogo()
      {
    
              //Get brand ID because loading uploadify.php triggers a new session
              var brand_id = jQuery('#brand_id').val();
    
              jQuery("#brand_btnBrowseLogo").uploadify({
                'uploader'       : siteURL + '/wp-content/plugins/uploadify/uploadify.swf',
                'script'         : siteURL + '/wp-content/plugins/uploadify/uploadify.php',
                'fileExt'        : '*.jpg;*.jpeg;*.png',
                'auto'           : true,
                'multi'          : false,
                'method'         : 'POST',
                'height'         : '29',
                'width'          : '136',
                'buttonImg'      : siteURL + '/wp-content/themes/storelocator/img/buttons/img_upload_grey_bg.png',
                'cancelImg'      : siteURL + '/wp-content/plugins/uploadify/cancel.png', 
                'scriptData'     : {'var1':'data1','var2':data2},
                'onComplete'     : function(event, queueID, fileObj, response, data) { 
                   // Do stuff here
                   }
    
                  // Show upload feedback
                  showFeedback(result.feedback);                    
                }
              });
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After testing my app with Instruments I realized that the current CSV parser I
I have WPF application. After testing my app on Windows7 and realized that opening
After testing a small site that I built for my school in Firefox, SeaMonkey,
I found out after testing that linux allows any character in a file name
when clicking on the button it does nothing ,,,after testing I concluded the problem
as usual i come here after testing around for hours and not having any
[Edited: After cross-testing on a fresh machine and some additional research, this appears to
After switching from firefox testing to internet explorer testing, some elements couldn't be found
After watching: The Clean Code Talks -- Inheritance, Polymorphism, & Testing I checked my
I'm a newbie to Unit Testing and I'm after some best practice advice. I'm

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.