By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,531 Members | 2,219 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,531 IT Pros & Developers. It's quick & easy.

Hidden value , popup , multiple form to upload file on same page

Fary4u
100+
P: 273
Hi Guys

i'm trying to upload a file, i've tried 3 different methods but still not work out i don't know how to over come this problem

hidden file value, multiple form or popup uploading.

1-

[HTML]<SCRIPT TYPE="text/javascript">
function popupform(myform, windowname)
{
if (! window.focus)return true;
window.open('', windowname, 'height=200,width=400,scrollbars=yes');
myform.target=windowname;
return true;
}
</SCRIPT>

<body>
<!-- Action=upload.asp give you result back with file name which u uploaded. !-->
<FORM METHOD=POST ACTION="http://www.fastcomshosting.co.uk/click/upload.asp" onSubmit="popupform(this, 'join')">
<input type="file" name="fName" > <input type=submit value="Upload . ">
</FORM>
[/HTML]
other method i'm using is

2-

form within another form which is onchange method can upload inline frame by passing value for example.

[HTML]<FORM ACTION="http://www.fastcomshosting.co.uk/click/upload.asp" method=post enctype="multipart/form-data" name="form">
<div id=ComboExample><p>Please click a button</p></div>
<input type="file" name="fName" value="" size="50" onchange="document.getElementById('ComboExample'). innerHTML='&lt;iframe src=&quot;upload.asp&quot; width=&quot;100%&quot; height=&quot;100&quot; scrolling=&quot;no&quot; frameborder=&quot;no&quot;&gt;&lt;/iframe&gt;'">
</FORM>
[/HTML]
3rd method i've tried is to passing textbox value as file path into file for example

[HTML]<input type="hidden" value="c:\test.jpg" name=hid>
<input type="file" name="fName" value="document.formname.hid" style="display: none">
[/HTML]
there is no problem by passing value into value but type as a file it's not take the value.

if any thing else that generate result on the same page by passing value please let me know

Regards
Farhan Shahid
Jul 18 '07 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
To upload a file without reloading/unloading the page, you need an iframe. See this thread.
Nov 5 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.