Jump to content

upload complete event detect


isaac_cm

Recommended Posts

Here's how I would do it. The pop-up presumably contains a form which goes to another page when the upload is done. E.g.,

<form action='somewhere.php' method='POST'>
<input type='file' name='fileUpload'/>
<input type='submit' value='Upload!' />
</form>

So in 'somewhere.php':

<?php
// Process the file upload here, then...
echo "<script type='text/javascript'>window.onload = function() {   window.opener.myVariable = myData; window.close();}</script>";
?>

This should set the variable myVariable in the parent window to the value in myData. Then it closes the upload window.

 

Hope that helps.

Link to comment
Share on other sites

I don't think there are any other ways, as JS is the only way to deal with the client side DOM (except maybe VBScript or client side ASP). But you definitely can't in HTML or PHP. If your worried about client browsers that don't support JS, check out this thread: http://www.phpfreaks.com/forums/index.php/topic,154030.0.html. Check if your client has JS. If not, just do the upload script in the main window.

Link to comment
Share on other sites

I have never used DreamWeaver. But for JS debugging I use FireFox's Error console. It typically gives at least the line number of an JS errors. For PHP debugging, I just use echo statements all over the place to figure out what's in the variables, etc. Sorry, I pretty much do my coding in a straight text editor!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.