Forums

ASP

This topic is locked

prlblems asp uplodad filename

Posted 14 Oct 2005 16:30:22
1
has voted
14 Oct 2005 16:30:22 Mauro Schiappelli posted:
I have problem with session file name beacus not save it! why??? thi is my code.... sigh help me please

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../ScriptLibrary/incPureUpload.asp" -->
<%
'*** Pure ASP File Upload 2.1.9
Dim GP_uploadAction,UploadQueryString
PureUploadSetup
If (CStr(Request.QueryString("GP_upload") <> "" Then
Dim pau_thePath,pau_Extensions,pau_Form,pau_Redirect,pau_storeType,pau_sizeLimit,pau_nameConflict,pau_requireUpload,pau_minWidth,pau_minHeight,pau_maxWidth,pau_maxHeight,pau_saveWidth,pau_saveHeight,pau_timeout,pau_progressBar,pau_progressWidth,pau_progressHeight
pau_thePath = """upload/user"""
pau_Extensions = ""
pau_Form = "segnalanews"
pau_Redirect = "segnalainvia.asp"
pau_storeType = "file"
pau_sizeLimit = ""
pau_nameConflict = "uniq"
pau_requireUpload = "false"
pau_minWidth = ""
pau_minHeight = ""
pau_maxWidth = ""
pau_maxHeight = ""
pau_saveWidth = ""
pau_saveHeight = ""
pau_timeout = "6000"
pau_progressBar = "fileCopyProgress.htm"
pau_progressWidth = "300"
pau_progressHeight = "100"

Dim RequestBin, UploadRequest
CheckPureUploadVersion 2.19
ProcessUpload pau_thePath,pau_Extensions,pau_Redirect,pau_storeType,pau_sizeLimit,pau_nameConflict,pau_requireUpload,pau_minWidth,pau_minHeight,pau_maxWidth,pau_maxHeight,pau_saveWidth,pau_saveHeight,pau_timeout
end if

If (CStr(Request.QueryString("GP_upload") <> "" Then
Session("filename1" = UploadFormRequest("file1"
Session("filename2" = UploadFormRequest("file2"
Session("filename3" = UploadFormRequest("file3"
Session("filename4" = UploadFormRequest("file4"
Session("filename5" = UploadFormRequest("file5"
end if

%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>

<HEAD>
<title>Le news</title>
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#"!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<script language="JavaScript">
<!--

<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape"&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->

function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?")>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}
//-->
</script>
&lt;META NAME="Author" Content="PS Digital Image & Web design e-mail<img src=../images/dmxzone/forum/icon_smile_tongue.gif border=0 align=middle> "&gt;
&lt;META HTTP-EQUIV="Cache-Control" CONTENT="no-cache"&gt;
&lt;script language="javascript" src="../ScriptLibrary/incPureUpload.js"&gt;&lt;/script&gt;
&lt;/HEAD&gt;

&lt;BODY BGCOLOR="787878" onLoad="MM_preloadImages('../immagini/back2.gif','../immagini/home2.gif','../immagini/eng2.gif')" link="#333333" vlink="#666666"&gt;
&lt;CENTER&gt;
&lt;P&gt;
&lt;TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" width="560"&gt;
&lt;tr&gt;
&lt;td width="109" valign="bottom" height="25"&gt;&nbsp;&lt;/td&gt;
&lt;td colspan="2"&gt;&lt;/td&gt;
&lt;td&gt;&lt;a name="top"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td valign="bottom" rowspan="2"&gt;&lt;img src="../immagini/logotop.gif" width="206" height="31"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="bottom" width="109"&gt;
&lt;table border="0" cellspacing="0" cellpadding="0"&gt;
&lt;tr&gt;
&lt;td width="54"&gt;&lt;a href="javascript:history.go(-1)" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image16','','../immagini/back2.gif',1)"&gt;&lt;img name="Image16" border="0" src="../immagini/back.gif" width="54" height="31"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td width="1"&gt;&lt;img src="../immagini/filo.gif" width="1" height="31"&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="../italiano/index.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image15','','../immagini/home2.gif',1)"&gt;&lt;img name="Image15" border="0" src="../immagini/home.gif" width="54" height="31"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/td&gt;
&lt;td valign="bottom" width="54"&gt;&lt;a href="../inglese/index.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image12','','../immagini/eng2.gif',1)"&gt;&lt;img name="Image12" border="0" src="../immagini/eng1.gif" width="54" height="31"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td valign="bottom" width="101"&gt;&lt;img src="../immagini/filo_101.gif" width="101" height="1"&gt;&lt;/td&gt;
&lt;td valign="bottom"&gt;&lt;img src="../immagini/filo_90.gif" width="90" height="1"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" width="560"&gt;
&lt;tr align="center"&gt;
&lt;td colspan="3" height="24" bgcolor="#343150"&gt;&lt;font size="2" face="Verdana, Arial, Helvetica" color="#FFFFFF"&gt;&lt;b&gt;Segnala
una News&lt;/b&gt;&lt;/font&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="3" bgcolor="#CCCCCC" valign="top"&gt;
&lt;table width="100%" border="0" cellpadding="5" cellspacing="1"&gt;
&lt;tr valign="top" bgcolor="#EBE8C0"&gt;
&lt;td colspan="2" bgcolor="#EBE8C0"&gt;
&lt;form action="&lt;%=GP_uploadAction%&gt;" method="post" enctype="multipart/form-data" name="segnalanews" onSubmit="return verifica(this);;checkFileUpload(this,'',false,'','','','','','','');showProgressWindow('fileCopyProgress.htm',300,100);return document.MM_returnValue"&gt;
&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;
&lt;tr valign="top"&gt;
&lt;td colspan="2"&gt;&lt;font size="2" face="Verdana, Arial, Helvetica, sans-serif"&gt;La
descrizione dell'allegato corrisponde al testo linkato al file.&lt;br&gt;
I tempi di caricamento variano a seconda della connessione.&lt;br&gt;
Terminato l'upload cambier&agrave; automaticamente pagina. &lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr valign="top"&gt;
&lt;td width="23%"&gt;&lt;font size="1" face="Verdana, Arial, Helvetica, sans-serif"&gt;&nbsp;&lt;/font&gt;&lt;/td&gt;
&lt;td width="77%"&gt;&lt;font size="1" face="Verdana, Arial, Helvetica, sans-serif"&gt;&nbsp;&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr valign="top"&gt;
&lt;td&gt;&lt;strong&gt;&lt;font size="1" face="Verdana, Arial, Helvetica, sans-serif"&gt;Allegato 1 &lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="1" face="Verdana, Arial, Helvetica, sans-serif"&gt;
&lt;INPUT NAME='file1' TYPE=FILE id="file1" onChange="checkOneFileUpload(this,'',false,'','','','','','','')" SIZE=40&gt;
&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr valign="top"&gt;
&lt;td width="23%"&gt;&lt;font size="1" face="Verdana, Arial, Helvetica, sans-serif"&gt;&nbsp;&lt;/font&gt;&lt;/td&gt;
&lt;td width="77%"&gt;&lt;font size="1" face="Verdana, Arial, Helvetica, sans-serif"&gt;&nbsp;&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr valign="top"&gt;
&lt;td&gt;&lt;strong&gt;&lt;font size="1" face="Verdana, Arial, Helvetica, sans-serif"&gt;Allegato
2&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="1" face="Verdana, Arial, Helvetica, sans-serif"&gt;
&lt;INPUT NAME='file2' TYPE=FILE id="file2" onChange="checkOneFileUpload(this,'',false,'','','','','','','')" SIZE=40&gt;
&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr valign="top"&gt;
&lt;td width="23%"&gt;&lt;font size="1" face="Verdana, Arial, Helvetica, sans-serif"&gt;&nbsp;&lt;/font&gt;&lt;/td&gt;
&lt;td width="77%"&gt;&lt;font size="1" face="Verdana, Arial, Helvetica, sans-serif"&gt;&nbsp;&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr valign="top"&gt;
&lt;td&gt;&lt;strong&gt;&lt;font size="1" face="Verdana, Arial, Helvetica, sans-serif"&gt;Allegato
3&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="1" face="Verdana, Arial, Helvetica, sans-serif"&gt;
&lt;INPUT NAME='file3' TYPE=FILE id="file3" onChange="checkOneFileUpload(this,'',false,'','','','','','','')" SIZE=40&gt;
&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr valign="top"&gt;
&lt;td width="23%"&gt;&lt;font size="1" face="Verdana, Arial, Helvetica, sans-serif"&gt;&nbsp;&lt;/font&gt;&lt;/td&gt;
&lt;td width="77%"&gt;&lt;font size="1" face="Verdana, Arial, Helvetica, sans-serif"&gt;&nbsp;&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr valign="top"&gt;
&lt;td&gt;&lt;strong&gt;&lt;font size="1" face="Verdana, Arial, Helvetica, sans-serif"&gt;Allegato
4&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="1" face="Verdana, Arial, Helvetica, sans-serif"&gt;
&lt;INPUT NAME='file4' TYPE=FILE id="file4" onChange="checkOneFileUpload(this,'',false,'','','','','','','')" SIZE=40&gt;
&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr valign="top"&gt;
&lt;td width="23%"&gt;&lt;font size="1" face="Verdana, Arial, Helvetica, sans-serif"&gt;&nbsp;&lt;/font&gt;&lt;/td&gt;
&lt;td width="77%"&gt;&lt;font size="1" face="Verdana, Arial, Helvetica, sans-serif"&gt;&nbsp;&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr valign="top"&gt;
&lt;td&gt;&lt;strong&gt;&lt;font size="1" face="Verdana, Arial, Helvetica, sans-serif"&gt;Allegato
5&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="1" face="Verdana, Arial, Helvetica, sans-serif"&gt;
&lt;INPUT NAME='file5' TYPE=FILE id="file5" onChange="checkOneFileUpload(this,'',false,'','','','','','','')" SIZE=40&gt;
&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr valign="top"&gt;
&lt;td&gt;&lt;font size="1" face="Verdana, Arial, Helvetica, sans-serif"&gt;&nbsp;&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;font size="1" face="Verdana, Arial, Helvetica, sans-serif"&gt;&nbsp;&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr valign="top"&gt;
&lt;td colspan="2"&gt; &lt;div align="center"&gt;
&lt;font size="1" face="Verdana, Arial, Helvetica, sans-serif"&gt;
&lt;input type="reset" name="Submit" value="Ripristina"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;input name="cmd" type="submit" id="cmd" value="salva allegati"&gt;
&lt;/font&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;input name="id" type="hidden" id="id" value="&lt;%
If (CStr(Request.QueryString("GP_upload") = "" Then
id = Request.QueryString("id"
Response.Write id
End if
%&gt;"&gt;
&lt;/form&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;TR&gt;
&lt;TD colspan="3" bgcolor="#FFFFFF"&gt;&lt;/TD&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" width="560"&gt;
&lt;TR&gt;
&lt;TD colspan="3" valign="top" bgcolor="#809999"&gt;&lt;/td&gt;&lt;/TR&gt;
&lt;tr align="right"&gt;
&lt;td width="330" height="20" background="../immagini/righino_card.gif"&gt;
&lt;div align="left"&gt;&lt;font size="1" color="#FFFFFF" face="Verdana, Arial, Helvetica"&gt;&nbsp; Ultimo
aggiornamento: 22 Dicembre 2004 &lt;/font&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td width="230" height="20" background="../immagini/righino_card.gif"&gt;&lt;font size="1" color="#FFFFFF" face="Verdana, Arial, Helvetica"&gt;&lt;b&gt;&copy;
2001 Centro CARDIOLOGICO Monzino&lt;/b&gt;&lt;/font&gt; &lt;/td&gt;
&lt;/TR&gt;
&lt;/TABLE&gt;
&lt;/CENTER&gt;

&lt;map name="Map"&gt;
&lt;area shape="rect" coords="2,1,60,69" href="../italiano/news/archive.htm"&gt;
&lt;/map&gt;
&lt;/BODY&gt;

&lt;/HTML&gt;

Replies

Replied 14 Oct 2005 16:32:52
14 Oct 2005 16:32:52 Mauro Schiappelli replied:
i make file name as unique and i want saved file names
Replied 14 Oct 2005 17:13:40
14 Oct 2005 17:13:40 Mauro Schiappelli replied:
i rewrite it in: but no ok gulp!!!!

&lt;%@LANGUAGE="VBSCRIPT"%&gt;
&lt;!--#include file="../ScriptLibrary/incPureUpload.asp" --&gt;
&lt;%
'*** Pure ASP File Upload 2.1.9
Dim GP_uploadAction,UploadQueryString
PureUploadSetup
If (CStr(Request.QueryString("GP_upload") &lt;&gt; "" Then
Dim pau_thePath,pau_Extensions,pau_Form,pau_Redirect,pau_storeType,pau_sizeLimit,pau_nameConflict,pau_requireUpload,pau_minWidth,pau_minHeight,pau_maxWidth,pau_maxHeight,pau_saveWidth,pau_saveHeight,pau_timeout,pau_progressBar,pau_progressWidth,pau_progressHeight
pau_thePath = """upload/user"""
pau_Extensions = ""
pau_Form = "segnalanews"
pau_Redirect = "segnalainvia.asp"
pau_storeType = "file"
pau_sizeLimit = ""
pau_nameConflict = "uniq"
pau_requireUpload = "false"
pau_minWidth = ""
pau_minHeight = ""
pau_maxWidth = ""
pau_maxHeight = ""
pau_saveWidth = ""
pau_saveHeight = ""
pau_timeout = "6000"
pau_progressBar = "fileCopyProgress.htm"
pau_progressWidth = "300"
pau_progressHeight = "100"

Dim RequestBin, UploadRequest
CheckPureUploadVersion 2.19
ProcessUpload pau_thePath,pau_Extensions,pau_Redirect,pau_storeType,pau_sizeLimit,pau_nameConflict,pau_requireUpload,pau_minWidth,pau_minHeight,pau_maxWidth,pau_maxHeight,pau_saveWidth,pau_saveHeight,pau_timeout

end if

If (CStr(Request.QueryString("GP_upload") &lt;&gt; "" Then
Session("file1" = UploadFormRequest("file1"
Session("file2" = UploadFormRequest("file2"
Session("file3" = UploadFormRequest("file3"
Session("file4" = UploadFormRequest("file4"
Session("file5" = UploadFormRequest("file5"
End If

Reply to this topic