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='<iframe src="upload.asp" width="100%" height="100" scrolling="no" frameborder="no"></iframe>'">
</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