File Upload in new window

They have: 218 posts

Joined: Apr 2001

Hi there,

I'm trying to process the ACTION of an upload form in a new window, but the upload file is showing up as empty by the server side script. Here's the form part:

<?php
$d
= \"<FORM name='photoForm' method='POST' enctype='multipart/form-data'\";

$ur = \"uploadScript.php\";   

$d .= \" ACTION=\\"javascript:void(pWin=window.open('$ur'+'&userfile='+document.photoForm.userfile.value+'&action=upload&nullCheck=1&cb=cPhotoFunc','phWin','width=300,height=300'));\\">\";

$d .= \"<INPUT TYPE='FILE' NAME='userfile'><IMG SRC='pixelshim.gif' height='1' width='6'><br><br>\";
?>

If the script is not processed in a new window, it works, but a new window is what I'm looking for. How can I make that work?

Thanks,

TM

They have: 461 posts

Joined: Jul 2003

try:

the target causes the submit to open a new window to do anything. the new window handles the input from the form.

another thing you might try is onClick="window.open('uploadwindow.extension', 'newwindow', 'height=whatever,width=whatever,...');"

POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.

They have: 218 posts

Joined: Apr 2001

Thanks, that worked great!

TM

They have: 461 posts

Joined: Jul 2003

np. glad to be of help.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.