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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:14:19+00:00 2026-05-24T19:14:19+00:00

Background : I’m working on a management page for musicians. Lets say the user

  • 0

Background: I’m working on a management page for musicians. Lets say the user creates an album, then uploads a song into the album. I’m using ajax posts with the jQuery form plugin.

First, I worked on uploading songs into existing albums (works great).

Then, I worked on creating new albums and showing up without a refresh using .append() and .attr (works great).

Now I’m working on uploading a song to the album that showed up thanks to the append()’s.

Problem: When the album that is created is prepared, it’s grand. All the values and functions are the exact same as the album loaded when the page renders.

When I attempt to upload a song, I get an error server-side. It takes the exact same functions i’m using to upload a song to the ajaxed album as the initial page rendering album.

I refresh the page, and I can upload a song.

I’m using jQuery.form plugin, and I thought it would be because the function was inside the $(document).ready(function { … }

the uploading script:

$('form#uploadSongToAlbum').submit(function() { 
  $(this).ajaxSubmit({
    target: 'login/uploadSongToAlbum.php',
    dataType:  'html',
    beforeSubmit: function() { 
      alert(showRequest);
      $.jGrowl("Uploading... hold on...<br />", { life:1000 });
    }, 
    success: function() {
      selectUploadedID(); 
    },
    error: function() {
      $.jGrowl(textStatus, {  header:"<span style='color:red'>Error:</span>", sticky: true });
    }
  });
  return false; 
});

Now, looking further into the problem, I opened up the console in Chrome, went to network and recorded the posted requests for both the ajaxed upload and the page-loaded upload, and I discovered very different values.
Here are the ajaxed upload post values (this one breaks):

Form Data:

file:silence2.mp3

album:80

and here are the page-loaded post values (this one works):

Request Payload:

——WebKitFormBoundaryZpJpGxBLJEBRYadH
Content-Disposition: form-data; name=”file”; filename=”silence2.mp3″
Content-Type: audio/mp3

——WebKitFormBoundaryZpJpGxBLJEBRYadH
Content-Disposition: form-data; name=”album”
80

——WebKitFormBoundaryZpJpGxBLJEBRYadH–

Thank you soo much in advance, everyone. I must be doing something wrong. I can provide more code if necessary. Keep in mind: The html markup and values for both ajaxed albums and page-loaded albums are valid. It must be something jQuery that I’m doing wrong…

  • 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-24T19:14:20+00:00Added an answer on May 24, 2026 at 7:14 pm

    Try adding the enctype attribute to the form tag of the dynamically created content:

    <form id="uploadSongToAlbum" action="login/uploadSongToAlbum.php" method="post" enctype="multipart/form-data">
        <!-- snip... -->
    </form>
    

    Also, if your uploading script is called from within $(document).ready, it will only be called once when the page loads. If you want it to apply to dynamically created forms, use the `live()’ method:

    $('form#uploadSongToAlbum').live('submit', function() { 
        // ajaxSubmit code here....
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background I am writing and using a very simple CGI-based (Perl) content management tool
Background (can skip to question below...) Currently working with a lego Mindstorm robot and
Background I have a basic HTML page with an iframe that points to a
Background: I'm working through the Programming Collective Intelligence book by Toby Segaran; specifically the
Background: I work for a company who utilizes Sharepoint for Task Management. We develop
Background I have a User Control (an .ascx file) which is being dynamically inserting
Background I have a web app that will create an image from user input.
Background: Our companies internal user's run our .Net programs on 10-20 windows terminal servers.
Background: I have a little video playing app with a UI inspired by the
Background: At my company we are developing a bunch applications that are using the

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.