SURF NY 1
04-27-2006, 10:22 PM
here's the deal. i copied an upload form right from viewsource of my filemanager. and the script looks like java. once uploaded it brings you to the folder that the file was uploaded too and it shows you the path of the file from the folder its in.
what im trying to do is not redirect to the folder. just show the full path of the file uploaded. im not sure if it is possible but i was wondering if it was from just editing the script that is on the page which i have included below.
<body>
<FORM METHOD=post enctype=multipart/form-data ACTION=/cgi-bin/util/fm_nmp/images NAME=a onsubmit="var X=new Date();this.action+=(this.action.indexOf('?')>-1?'&':'?')+'Xtime='+X.getTime();" STYLE="margin:0;">
<table style="" CELLSPACING="0" CELLPADDING=4 class="normaltable">
<tr class="tableheading"><td colspan=2><font face="Tahoma" size="2">Make
sure you resize the image to a width of <b>no more then 200 pixels!!!!</b></font></td></tr>
<tr class="tablerow1" VALIGN=top>
<td><font face="Tahoma" size="2">File 1</font></td>
<td><font face="Tahoma"><input type=file name=uploadfile1 size=50 CLASS=button></font></td>
</tr>
<tr class="tablesubheading"><td colspan=2><font face="Tahoma"><input type=submit class=button name=upload value="Upload!"><input type=button name="upcancel" value="Cancel" onclick="docancel();" CLASS=button onmouseover="this.className='buttonmouseover';" onmouseout="this.className='button';"></font></td></tr>
</table>
<font size="2" face="Tahoma">
<script><!--
function get_filename(n) {
var p = '//images/' + n;
while (p.indexOf('//')>-1) p=p.substring(0,p.indexOf('//'))+'/'+p.substring(p.indexOf('//')+2);
p = p.replace(/\+/,'%252B');
return p;
}
function get_path(n) {
var p = '/cgi-bin/util/fm/' + get_filename(n);
while (p.indexOf('//')>-1) p=p.substring(0,p.indexOf('//'))+'/'+p.substring(p.indexOf('//')+2);
return p;
}
function get_files(full_path) {
var a = new Array();
var files = document.a.files;
if (! files) {
// do nothing - there are no files
} else if (! files.length && files.length != 0) {
if (files.checked)
a[a.length] = full_path ? get_filename(files.value.substring(2)) : files.value.substring(2)
} else {
for(var i=0; i<files.length; i++)
if (files[i].checked)
a[a.length] = full_path ? get_filename(files[i].value.substring(2)) : files[i].value.substring(2)
}
return a;
}
function qs(key,arr) {
var t=key+'='+escape(arr[0]);
for (var i=1;i<arr.length;i++) t+='&'+key+'='+escape(arr[i]);
t = t.replace(/\+/,'%2B');
return t;
}
function docancel() {
location.href = get_path("");
}
//--></script> </font>
</body>
what im trying to do is not redirect to the folder. just show the full path of the file uploaded. im not sure if it is possible but i was wondering if it was from just editing the script that is on the page which i have included below.
<body>
<FORM METHOD=post enctype=multipart/form-data ACTION=/cgi-bin/util/fm_nmp/images NAME=a onsubmit="var X=new Date();this.action+=(this.action.indexOf('?')>-1?'&':'?')+'Xtime='+X.getTime();" STYLE="margin:0;">
<table style="" CELLSPACING="0" CELLPADDING=4 class="normaltable">
<tr class="tableheading"><td colspan=2><font face="Tahoma" size="2">Make
sure you resize the image to a width of <b>no more then 200 pixels!!!!</b></font></td></tr>
<tr class="tablerow1" VALIGN=top>
<td><font face="Tahoma" size="2">File 1</font></td>
<td><font face="Tahoma"><input type=file name=uploadfile1 size=50 CLASS=button></font></td>
</tr>
<tr class="tablesubheading"><td colspan=2><font face="Tahoma"><input type=submit class=button name=upload value="Upload!"><input type=button name="upcancel" value="Cancel" onclick="docancel();" CLASS=button onmouseover="this.className='buttonmouseover';" onmouseout="this.className='button';"></font></td></tr>
</table>
<font size="2" face="Tahoma">
<script><!--
function get_filename(n) {
var p = '//images/' + n;
while (p.indexOf('//')>-1) p=p.substring(0,p.indexOf('//'))+'/'+p.substring(p.indexOf('//')+2);
p = p.replace(/\+/,'%252B');
return p;
}
function get_path(n) {
var p = '/cgi-bin/util/fm/' + get_filename(n);
while (p.indexOf('//')>-1) p=p.substring(0,p.indexOf('//'))+'/'+p.substring(p.indexOf('//')+2);
return p;
}
function get_files(full_path) {
var a = new Array();
var files = document.a.files;
if (! files) {
// do nothing - there are no files
} else if (! files.length && files.length != 0) {
if (files.checked)
a[a.length] = full_path ? get_filename(files.value.substring(2)) : files.value.substring(2)
} else {
for(var i=0; i<files.length; i++)
if (files[i].checked)
a[a.length] = full_path ? get_filename(files[i].value.substring(2)) : files[i].value.substring(2)
}
return a;
}
function qs(key,arr) {
var t=key+'='+escape(arr[0]);
for (var i=1;i<arr.length;i++) t+='&'+key+'='+escape(arr[i]);
t = t.replace(/\+/,'%2B');
return t;
}
function docancel() {
location.href = get_path("");
}
//--></script> </font>
</body>