<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1029425" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1029425</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/asp-upload#comment-1172220</link>
    <description> &lt;p&gt;erm.... well i best start of by saying thank you for that. But its way over may head.&lt;/p&gt;
&lt;p&gt;The system i trying to get working to a Intractive Intranet. staff can upload documents and so others can search for them. But.... what i dont want them to do is upload the same file and replace them.&lt;/p&gt;
 </description>
     <pubDate>Wed, 01 Jun 2005 13:05:50 +0000</pubDate>
 <dc:creator>dhotchin</dc:creator>
 <guid isPermaLink="false">comment 1172220 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/asp-upload#comment-1172218</link>
    <description> &lt;p&gt;Well, I&#039;m sticking to a semi-conceptual description of what to do as I&#039;m not confident guaranteeing my rusty VB/ASP will work. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;What I&#039;m suggesting is at the point where you &lt;strong&gt;know the name of the file&lt;/strong&gt; trying to be uploaded and &lt;strong&gt;before it is copied&lt;/strong&gt; to the final location, you simply check to see if a file of the same name already exists. This point is, if I&#039;m right, within the loop that iterates over the files being sent that are to be copied.&lt;/p&gt;
&lt;p&gt;This is done by using an &lt;strong&gt;if&lt;/strong&gt; conditional and the FileExists method of a FileSystemObject. Server.MapPath is used to provide the proper physical path of the file to FileExists (adjust as necessary). Note that you might need to create a new FileSystemObject to do this, which, for illustrative purposes, I&#039;ve called &lt;strong&gt;fs&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;So if a pre-existing file is not found, then you can proceed with the copying as is presently the case. However if a conficting file does exist, you can handle the error in any number of ways. You could right then redirect the user to an error page (but this would halt uploads of subsequent files in fileItems). Or you could store the names of the conflicting items in another location/variable/file/database (whatever you please), and use that to report errors in the final page. Selecting the best strategy for this depends really on how the rest of your program operates, how errors are generally handled if there&#039;s already an error handling mechanism, and so on.&lt;/p&gt;
&lt;p&gt;Hope that makes sense. If it&#039;s no help, tell me, and I&#039;ll see if I can write up some code. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Wed, 01 Jun 2005 12:34:01 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1172218 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/asp-upload#comment-1172191</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;&lt;strong&gt;Abhishek Reddy wrote:&lt;/strong&gt; Probably in here:&lt;br /&gt;
&lt;code&gt;		For Each fileItem In UploadedFiles.Items&lt;/code&gt;&#039;&lt;br /&gt;
you&#039;ll want to test &lt;strong&gt;if fs.FileExists(Server.MapPath(fileItem.FileName))=true&lt;/strong&gt;. QUOTE]&lt;/p&gt;
&lt;p&gt;Are you saying if i insert this line of code it will check to see if the file is already on the server? If so, what is the best way to send the user to a error page which states their problem?&lt;/p&gt;
&lt;p&gt;There is a live demo of what i&#039;m trying to do if you would like to look at it? You will need a username and password. just let me know if need.&lt;/p&gt;&lt;/blockquote&gt;
 </description>
     <pubDate>Tue, 31 May 2005 22:03:50 +0000</pubDate>
 <dc:creator>dhotchin</dc:creator>
 <guid isPermaLink="false">comment 1172191 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/asp-upload#comment-1172174</link>
    <description> &lt;p&gt;I hate VB &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/sad.png&quot; title=&quot;Sad&quot; alt=&quot;Sad&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Tue, 31 May 2005 18:06:11 +0000</pubDate>
 <dc:creator>bja888</dc:creator>
 <guid isPermaLink="false">comment 1172174 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/asp-upload#comment-1172144</link>
    <description> &lt;p&gt;Probably in here:&lt;br /&gt;
&lt;code&gt;		For Each fileItem In UploadedFiles.Items&lt;/code&gt;&#039;&lt;br /&gt;
you&#039;ll want to test &lt;strong&gt;if fs.FileExists(Server.MapPath(fileItem.FileName))=true&lt;/strong&gt;. If it does exist, redirect to an error page. If it doesn&#039;t exist, proceed with the copy &amp;amp; save.&lt;/p&gt;
&lt;p&gt;Or, rather than redirecting immediately, store a list a of conflicts somewhere, and use that in a report in the second page. &lt;/p&gt;
&lt;p&gt;Any good?&lt;/p&gt;
 </description>
     <pubDate>Tue, 31 May 2005 08:18:27 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1172144 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/asp-upload#comment-1172097</link>
    <description> &lt;p&gt;I&#039;m still having no luck. The script used above, acts if i already know the file, which i dont. I may be wrong.&lt;/p&gt;
&lt;p&gt;I have two pages. the upload page with a text field and browse to computer form. Which has a file attached (code is below). Then when the file is uploaded browser open a new page which input the file name in to a text box and other details the user imputs then adds the data to a access database.&lt;/p&gt;
&lt;p&gt;But i need something when the file is trying to be uploaded it then comes up with an error.&lt;/p&gt;
&lt;p&gt;Upload script&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;%&lt;br /&gt;Class FreeASPUpload&lt;br /&gt;	Public UploadedFiles&lt;br /&gt;	Public FormElements&lt;br /&gt;&lt;br /&gt;	Private VarArrayBinRequest&lt;br /&gt;	Private StreamRequest&lt;br /&gt;	Private uploadedYet&lt;br /&gt;&lt;br /&gt;	Private Sub Class_Initialize()&lt;br /&gt;		Set UploadedFiles = Server.CreateObject(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;		Set FormElements = Server.CreateObject(&amp;quot;Scripting.Dictionary&amp;quot;)&lt;br /&gt;		Set StreamRequest = Server.CreateObject(&amp;quot;ADODB.Stream&amp;quot;)&lt;br /&gt;		StreamRequest.Type = 1 &amp;#039;adTypeBinary&lt;br /&gt;		StreamRequest.Open&lt;br /&gt;		uploadedYet = false&lt;br /&gt;	End Sub&lt;br /&gt;	&lt;br /&gt;	Private Sub Class_Terminate()&lt;br /&gt;		If IsObject(UploadedFiles) Then&lt;br /&gt;			UploadedFiles.RemoveAll()&lt;br /&gt;			Set UploadedFiles = Nothing&lt;br /&gt;		End If&lt;br /&gt;		If IsObject(FormElements) Then&lt;br /&gt;			FormElements.RemoveAll()&lt;br /&gt;			Set FormElements = Nothing&lt;br /&gt;		End If&lt;br /&gt;		StreamRequest.Close&lt;br /&gt;		Set StreamRequest = Nothing&lt;br /&gt;	End Sub&lt;br /&gt;&lt;br /&gt;	Public Property Get Form(sIndex)&lt;br /&gt;		Form = &amp;quot;&amp;quot;&lt;br /&gt;		If FormElements.Exists(LCase(sIndex)) Then Form = FormElements.Item(LCase(sIndex))&lt;br /&gt;	End Property&lt;br /&gt;&lt;br /&gt;	Public Property Get Files()&lt;br /&gt;		Files = UploadedFiles.Items&lt;br /&gt;	End Property&lt;br /&gt;&lt;br /&gt;	&amp;#039;Calls Upload to extract the data from the binary request and then saves the uploaded files&lt;br /&gt;	Public Sub Save(path)&lt;br /&gt;		Dim streamFile, fileItem&lt;br /&gt;&lt;br /&gt;		if Right(path, 1) &amp;lt;&amp;gt; &amp;quot;\&amp;quot; then path = path &amp;amp; &amp;quot;\&amp;quot;&lt;br /&gt;&lt;br /&gt;		if not uploadedYet then Upload&lt;br /&gt;&lt;br /&gt;		For Each fileItem In UploadedFiles.Items&lt;br /&gt;			Set streamFile = Server.CreateObject(&amp;quot;ADODB.Stream&amp;quot;)&lt;br /&gt;			streamFile.Type = 1&lt;br /&gt;			streamFile.Open&lt;br /&gt;			StreamRequest.Position=fileItem.Start&lt;br /&gt;			StreamRequest.CopyTo streamFile, fileItem.Length&lt;br /&gt;			streamFile.SaveToFile path &amp;amp; fileItem.FileName, 2&lt;br /&gt;			streamFile.close&lt;br /&gt;			Set streamFile = Nothing&lt;br /&gt;			fileItem.Path = path &amp;amp; fileItem.FileName&lt;br /&gt;		 Next&lt;br /&gt;	End Sub&lt;br /&gt;&lt;br /&gt;	Public Function SaveBinRequest(path) &amp;#039; For debugging purposes&lt;br /&gt;		StreamRequest.SaveToFile path &amp;amp; &amp;quot;\debugStream.bin&amp;quot;, 2&lt;br /&gt;	End Function&lt;br /&gt;&lt;br /&gt;	Public Sub DumpData() &amp;#039;only works if files are plain text&lt;br /&gt;		Dim i, aKeys, f&lt;br /&gt;		response.write &amp;quot;Form Items:&amp;lt;br&amp;gt;&amp;quot;&lt;br /&gt;		aKeys = FormElements.Keys&lt;br /&gt;		For i = 0 To FormElements.Count -1 &amp;#039; Iterate the array&lt;br /&gt;			response.write aKeys(i) &amp;amp; &amp;quot; = &amp;quot; &amp;amp; FormElements.Item(aKeys(i)) &amp;amp; &amp;quot;&amp;lt;BR&amp;gt;&amp;quot;&lt;br /&gt;		Next&lt;br /&gt;		response.write &amp;quot;Uploaded Files:&amp;lt;br&amp;gt;&amp;quot;&lt;br /&gt;		For Each f In UploadedFiles.Items&lt;br /&gt;			response.write &amp;quot;Name: &amp;quot; &amp;amp; f.FileName &amp;amp; &amp;quot;&amp;lt;br&amp;gt;&amp;quot;&lt;br /&gt;			response.write &amp;quot;Type: &amp;quot; &amp;amp; f.ContentType &amp;amp; &amp;quot;&amp;lt;br&amp;gt;&amp;quot;&lt;br /&gt;			response.write &amp;quot;Start: &amp;quot; &amp;amp; f.Start &amp;amp; &amp;quot;&amp;lt;br&amp;gt;&amp;quot;&lt;br /&gt;			response.write &amp;quot;Size: &amp;quot; &amp;amp; f.Length &amp;amp; &amp;quot;&amp;lt;br&amp;gt;&amp;quot;&lt;br /&gt;		 Next&lt;br /&gt;&amp;nbsp;&amp;nbsp; 	End Sub&lt;br /&gt;&lt;br /&gt;	Private Sub Upload()&lt;br /&gt;		Dim nCurPos, nDataBoundPos, nLastSepPos&lt;br /&gt;		Dim nPosFile, nPosBound&lt;br /&gt;		Dim sFieldName, osPathSep, auxStr&lt;br /&gt;&lt;br /&gt;		&amp;#039;RFC1867 Tokens&lt;br /&gt;		Dim vDataSep&lt;br /&gt;		Dim tNewLine, tDoubleQuotes, tTerm, tFilename, tName, tContentDisp, tContentType&lt;br /&gt;		tNewLine = Byte2String(Chr(13))&lt;br /&gt;		tDoubleQuotes = Byte2String(Chr(34))&lt;br /&gt;		tTerm = Byte2String(&amp;quot;--&amp;quot;)&lt;br /&gt;		tFilename = Byte2String(&amp;quot;filename=&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;		tName = Byte2String(&amp;quot;name=&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;		tContentDisp = Byte2String(&amp;quot;Content-Disposition&amp;quot;)&lt;br /&gt;		tContentType = Byte2String(&amp;quot;Content-Type:&amp;quot;)&lt;br /&gt;&lt;br /&gt;		uploadedYet = true&lt;br /&gt;&lt;br /&gt;		on error resume next&lt;br /&gt;		VarArrayBinRequest = Request.BinaryRead(Request.TotalBytes)&lt;br /&gt;		if Err.Number &amp;lt;&amp;gt; 0 then &lt;br /&gt;			response.write &amp;quot;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;B&amp;gt;System reported this error:&amp;lt;/B&amp;gt;&amp;lt;p&amp;gt;&amp;quot;&lt;br /&gt;			response.write Err.Description &amp;amp; &amp;quot;&amp;lt;p&amp;gt;&amp;quot;&lt;br /&gt;			response.write &amp;quot;The most likely cause for this error is the incorrect setup of AspMaxRequestEntityAllowed in IIS MetaBase. &amp;lt;p&amp;gt;&amp;quot;&lt;br /&gt;			Exit Sub&lt;br /&gt;		end if&lt;br /&gt;		on error goto 0 &amp;#039;reset error handling&lt;br /&gt;&lt;br /&gt;		nCurPos = FindToken(tNewLine,1) &amp;#039;Note: nCurPos is 1-based (and so is InstrB, MidB, etc)&lt;br /&gt;&lt;br /&gt;		If nCurPos &amp;lt;= 1&amp;nbsp; Then Exit Sub&lt;br /&gt;		 &lt;br /&gt;		&amp;#039;vDataSep is a separator like -----------------------------21763138716045&lt;br /&gt;		vDataSep = MidB(VarArrayBinRequest, 1, nCurPos-1)&lt;br /&gt;&lt;br /&gt;		&amp;#039;Start of current separator&lt;br /&gt;		nDataBoundPos = 1&lt;br /&gt;&lt;br /&gt;		&amp;#039;Beginning of last line&lt;br /&gt;		nLastSepPos = FindToken(vDataSep &amp;amp; tTerm, 1)&lt;br /&gt;&lt;br /&gt;		Do Until nDataBoundPos = nLastSepPos&lt;br /&gt;			&lt;br /&gt;			nCurPos = SkipToken(tContentDisp, nDataBoundPos)&lt;br /&gt;			nCurPos = SkipToken(tName, nCurPos)&lt;br /&gt;			sFieldName = ExtractField(tDoubleQuotes, nCurPos)&lt;br /&gt;&lt;br /&gt;			nPosFile = FindToken(tFilename, nCurPos)&lt;br /&gt;			nPosBound = FindToken(vDataSep, nCurPos)&lt;br /&gt;			&lt;br /&gt;			If nPosFile &amp;lt;&amp;gt; 0 And&amp;nbsp; nPosFile &amp;lt; nPosBound Then&lt;br /&gt;				Dim oUploadFile&lt;br /&gt;				Set oUploadFile = New UploadedFile&lt;br /&gt;				&lt;br /&gt;				nCurPos = SkipToken(tFilename, nCurPos)&lt;br /&gt;				auxStr = ExtractField(tDoubleQuotes, nCurPos)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#039; We are interested only in the name of the file, not the whole path&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#039; Path separator is \ in windows, / in UNIX&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#039; While IE seems to put the whole pathname in the stream, Mozilla seem to &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#039; only put the actual file name, so UNIX paths may be rare. But not impossible.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; osPathSep = &amp;quot;\&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if InStr(auxStr, osPathSep) = 0 then osPathSep = &amp;quot;/&amp;quot;&lt;br /&gt;				oUploadFile.FileName = Right(auxStr, Len(auxStr)-InStrRev(auxStr, osPathSep))&lt;br /&gt;&lt;br /&gt;				if (Len(oUploadFile.FileName) &amp;gt; 0) then &amp;#039;File field not left empty&lt;br /&gt;					nCurPos = SkipToken(tContentType, nCurPos)&lt;br /&gt;					&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; auxStr = ExtractField(tNewLine, nCurPos)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#039; NN on UNIX puts things like this in the streaa:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#039;&amp;nbsp;&amp;nbsp;&amp;nbsp; ?? python py type=?? python application/x-python&lt;br /&gt;					oUploadFile.ContentType = Right(auxStr, Len(auxStr)-InStrRev(auxStr, &amp;quot; &amp;quot;))&lt;br /&gt;					nCurPos = FindToken(tNewLine, nCurPos) + 4 &amp;#039;skip empty line&lt;br /&gt;					&lt;br /&gt;					oUploadFile.Start = nCurPos-1&lt;br /&gt;					oUploadFile.Length = FindToken(vDataSep, nCurPos) - 2 - nCurPos&lt;br /&gt;					&lt;br /&gt;					If oUploadFile.Length &amp;gt; 0 Then UploadedFiles.Add LCase(sFieldName), oUploadFile&lt;br /&gt;				End If&lt;br /&gt;			Else&lt;br /&gt;				Dim nEndOfData&lt;br /&gt;				nCurPos = FindToken(tNewLine, nCurPos) + 4 &amp;#039;skip empty line&lt;br /&gt;				nEndOfData = FindToken(vDataSep, nCurPos) - 2&lt;br /&gt;				If Not FormElements.Exists(LCase(sFieldName)) Then FormElements.Add LCase(sFieldName), String2Byte(MidB(VarArrayBinRequest, nCurPos, nEndOfData-nCurPos))&lt;br /&gt;			End If&lt;br /&gt;&lt;br /&gt;			&amp;#039;Advance to next separator&lt;br /&gt;			nDataBoundPos = FindToken(vDataSep, nCurPos)&lt;br /&gt;		Loop&lt;br /&gt;		StreamRequest.Write(VarArrayBinRequest)&lt;br /&gt;	End Sub&lt;br /&gt;&lt;br /&gt;	Private Function SkipToken(sToken, nStart)&lt;br /&gt;		SkipToken = InstrB(nStart, VarArrayBinRequest, sToken)&lt;br /&gt;		If SkipToken = 0 then&lt;br /&gt;			Response.write &amp;quot;Error in parsing uploaded binary request.&amp;quot;&lt;br /&gt;			Response.End&lt;br /&gt;		end if&lt;br /&gt;		SkipToken = SkipToken + LenB(sToken)&lt;br /&gt;	End Function&lt;br /&gt;&lt;br /&gt;	Private Function FindToken(sToken, nStart)&lt;br /&gt;		FindToken = InstrB(nStart, VarArrayBinRequest, sToken)&lt;br /&gt;	End Function&lt;br /&gt;&lt;br /&gt;	Private Function ExtractField(sToken, nStart)&lt;br /&gt;		Dim nEnd&lt;br /&gt;		nEnd = InstrB(nStart, VarArrayBinRequest, sToken)&lt;br /&gt;		If nEnd = 0 then&lt;br /&gt;			Response.write &amp;quot;Error in parsing uploaded binary request.&amp;quot;&lt;br /&gt;			Response.End&lt;br /&gt;		end if&lt;br /&gt;		ExtractField = String2Byte(MidB(VarArrayBinRequest, nStart, nEnd-nStart))&lt;br /&gt;	End Function&lt;br /&gt;&lt;br /&gt;	&amp;#039;String to byte string conversion&lt;br /&gt;	Private Function Byte2String(sString)&lt;br /&gt;		Dim i&lt;br /&gt;		For i = 1 to Len(sString)&lt;br /&gt;		&amp;nbsp;&amp;nbsp; Byte2String = Byte2String &amp;amp; ChrB(AscB(Mid(sString,i,1)))&lt;br /&gt;		Next&lt;br /&gt;	End Function&lt;br /&gt;&lt;br /&gt;	&amp;#039;Byte string to string conversion&lt;br /&gt;	Private Function String2Byte(bsString)&lt;br /&gt;		Dim i&lt;br /&gt;		String2Byte =&amp;quot;&amp;quot;&lt;br /&gt;		For i = 1 to LenB(bsString)&lt;br /&gt;		&amp;nbsp;&amp;nbsp; String2Byte = String2Byte &amp;amp; Chr(AscB(MidB(bsString,i,1))) &lt;br /&gt;		Next&lt;br /&gt;	End Function&lt;br /&gt;End Class&lt;br /&gt;&lt;br /&gt;Class UploadedFile&lt;br /&gt;	Public ContentType&lt;br /&gt;	Public Start&lt;br /&gt;	Public Length&lt;br /&gt;	Public Path&lt;br /&gt;	Private nameOfFile&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#039; Need to remove characters that are valid in UNIX, but not in Windows&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Property Let FileName(fN)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameOfFile = fN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameOfFile = SubstNoReg(nameOfFile, &amp;quot;\&amp;quot;, &amp;quot;_&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameOfFile = SubstNoReg(nameOfFile, &amp;quot;/&amp;quot;, &amp;quot;_&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameOfFile = SubstNoReg(nameOfFile, &amp;quot;:&amp;quot;, &amp;quot;_&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameOfFile = SubstNoReg(nameOfFile, &amp;quot;*&amp;quot;, &amp;quot;_&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameOfFile = SubstNoReg(nameOfFile, &amp;quot;?&amp;quot;, &amp;quot;_&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameOfFile = SubstNoReg(nameOfFile, &amp;quot;&amp;quot;&amp;quot;&amp;quot;, &amp;quot;_&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameOfFile = SubstNoReg(nameOfFile, &amp;quot;&amp;lt;&amp;quot;, &amp;quot;_&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameOfFile = SubstNoReg(nameOfFile, &amp;quot;&amp;gt;&amp;quot;, &amp;quot;_&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameOfFile = SubstNoReg(nameOfFile, &amp;quot;|&amp;quot;, &amp;quot;_&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Property&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Property Get FileName()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileName = nameOfFile&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Property&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#039;Public Property Get FileN()ame&lt;br /&gt;End Class&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;#039; Does not depend on RegEx, which is not available on older VBScript&lt;br /&gt;&amp;#039; Is not recursive, which means it will not run out of stack space&lt;br /&gt;Function SubstNoReg(initialStr, oldStr, newStr)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim currentPos, oldStrPos, skip&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If IsNull(initialStr) Or Len(initialStr) = 0 Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubstNoReg = &amp;quot;&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ElseIf IsNull(oldStr) Or Len(oldStr) = 0 Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubstNoReg = initialStr&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If IsNull(newStr) Then newStr = &amp;quot;&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; currentPos = 1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oldStrPos = 0&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubstNoReg = &amp;quot;&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; skip = Len(oldStr)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do While currentPos &amp;lt;= Len(initialStr)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oldStrPos = InStr(currentPos, initialStr, oldStr)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If oldStrPos = 0 Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubstNoReg = SubstNoReg &amp;amp; Mid(initialStr, currentPos, Len(initialStr) - currentPos + 1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; currentPos = Len(initialStr) + 1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubstNoReg = SubstNoReg &amp;amp; Mid(initialStr, currentPos, oldStrPos - currentPos) &amp;amp; newStr&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; currentPos = oldStrPos + skip&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Loop&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;End Function&lt;br /&gt;%&amp;gt;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Mon, 30 May 2005 19:29:49 +0000</pubDate>
 <dc:creator>dhotchin</dc:creator>
 <guid isPermaLink="false">comment 1172097 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/asp-upload#comment-1172088</link>
    <description> &lt;p&gt;Use FileSystemObject.FileExists to check if the file exists. If it does exist, have it trigger your redirection (Response.Redirect or however it is your server or scripts does it). Else, proceed with the upload.&lt;br /&gt;
FileExists: &lt;a href=&quot;http://www.w3schools.com/asp/showfile.asp?filename=demo_fileexists&quot; class=&quot;bb-url&quot;&gt;http://www.w3schools.com/asp/showfile.asp?filename=demo_fileexists&lt;/a&gt;&lt;br /&gt;
More on FSO: &lt;a href=&quot;http://www.w3schools.com/asp/asp_ref_filesystem.asp&quot; class=&quot;bb-url&quot;&gt;http://www.w3schools.com/asp/asp_ref_filesystem.asp&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Mon, 30 May 2005 18:47:50 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1172088 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
