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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:46:41+00:00 2026-06-14T03:46:41+00:00

I am uploading files via an iframe. I am sending my uploaded files to

  • 0

I am uploading files via an iframe. I am sending my uploaded files to a php page that returns either a number to display a message or a block of html that I’d like to use to replace a table on my parent page that lists all uploaded files for that user. On my php processing page I have:

upload_process.php

<script language="javascript" type="text/javascript"> 
window.top.window.stopUpload(<?php echo $result;?>);
</script> 

$result is returning:

<tr><td><input name='checkbox[]' type='checkbox' id='checkbox[]' value='43'></td><td><a href='../php/viewimages.php?id=13')'>New One</a></td><td>Clincal Literature</td><td>2012-11-11</td></tr>

Firebug is throwing: SyntaxError: XML tag name mismatch (expected input) and has an arrow pointing to the </td> after value=43

The function that is running on the home page when I get this error is:

<script type="text/javascript">
    function startUpload() {
        document.getElementById('f1_upload_process').style.visibility = 'visible';
        return true;
    }

    function stopUpload(success) {
        var result = '';
        if (success == 0) {
            document.getElementById('result').innerHTML = '<div class="msg-error" style="width:492px;">There was an error during file upload!<\/div><br/>';
        } else if (success == 2) {
            document.getElementById('result').innerHTML = '<div class="msg-error" style="width:492px;">ERROR! Please upload a document with the following file types....<br/><br/>txt, doc, xls, rtf, ppt, pdf, jpg, jpeg, gif, png, xlsx, docx, png, pps, ppsx, ppt<\/div><br/>';
        } else {
            window.top.document.getElementById('attachment_table').innerHTML = result;
            document.getElementById('result').innerHTML = '<div class="msg-status" style="width:492px;">The file was uploaded successfully!<\/div><br/>';
        }
        document.getElementById('f1_upload_process').style.visibility = 'hidden';
        return true;
    }
</script>

Can someone point me in the direction of what I’m doing wrong? I’m a self taught noob and I usually use jquery/ajax for this solution but since I’m dealing with files I’m forced to use iframe on this. Thx!

  • 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-14T03:46:43+00:00Added an answer on June 14, 2026 at 3:46 am

    Your upload_process.php seems to have a few escaping problems. According to your question, the following is returned (also check this with Firebug):

    <script language="javascript" type="text/javascript"> 
    window.top.window.stopUpload(<tr><td><input name='checkbox[]' type='checkbox' id='checkbox[]' value='43'></td><td><a href='../php/viewimages.php?id=13')'>New One</a></td><td>Clincal Literature</td><td>2012-11-11</td></tr>);
    </script> 
    

    It seems to be XML-parsed (or at least by something that throws an XML-related error), and says that the <input> tag is not properly closed but immediately followed by </td>. You should always output script contents inside a cdata-section, enclose them into a comment or escape the tags and quotes.

    Also, check content-type headers and HTML doctypes etc of your answer, they might not be correct. It does not consist only of the <script> tag, does it?

    Next, the arguments you pass to the JS-function stopUpload should be a string. The plain HTML string there makes the script invalid. Enclose it in quotes, and escape any quotes inside (it’s OK, you’ve used apostrophes only for now).

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

Sidebar

Related Questions

In my project I have a file uploading feature. Files are uploaded via FTP.
Uploading files (images) via ajax multi-uploader (http://github.com/valums/file-uploader). Each uploaded file is saved in temp
I have an application that in uploading files to GridFS via MongoMapper/Joint in Padrino.
I have a process that uploads files via PHP but the resulting files end
Possible Duplicate: Stop people uploading malicious PHP files via forms i found a way
My colleague has been uploading files via PHP hosted on Windows Server 2008 IIS
I am experiencing difficulties with uploading files via ajax without sing html form. My
I have a java applet for uploading files to server. I want to display
I'm uploading files via JS and storing the temp path in the session. Than
We have a few 100 users logging in via FTP and uploading files. Our

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.