<% Option Explicit 'Stores only files with size less than MaxFileSize Dim DestinationPath DestinationPath = Server.mapPath("Uploads") 'Create upload form 'Using Huge-ASP file upload 'Dim Form: Set Form = Server.CreateObject("ScriptUtils.ASPForm") 'Using Pure-ASP file upload Dim Form: Set Form = New ASPForm %><% 'Pure-ASP upload v. 2.06 (with progress bar) 'This software is a FreeWare with limitted use. '1. You can use this software to upload files with size up to 10MB for free ' if you want to upload bigger files, please register ScriptUtilities and Huge-ASP upload ' See license info at http://asp-upload.borec.net '2. I'll be glad if you include Pure ASP file upload ' or similar text link to http://www.motobit.com on the web site using Pure-ASP upload. 'Feel free to send comments/suggestions to help@pstruh.cz Const adTypeBinary = 1 Const adTypeText = 2 Const xfsCompleted = &H0 '0 Form was successfully processed. Const xfsNotPost = &H1 '1 Request method is NOT post Const xfsZeroLength = &H2 '2 Zero length request (there are no data in a source form) Const xfsInProgress = &H3 '3 Form is in a middle of process. Const xfsNone = &H5 '5 Initial form state Const xfsError = &HA '10 Const xfsNoBoundary = &HB '11 Boundary of multipart/form-data is not specified. Const xfsUnknownType = &HC '12 Unknown source form (Content-type must be multipart/form-data) Const xfsSizeLimit = &HD '13 Form size exceeds allowed limit (ScriptUtils.ASPForm.SizeLimit) Const xfsTimeOut = &HE '14 Upload time exceeds allowed limit (ScriptUtils.ASPForm.ReadTimeout) Const xfsNoConnected = &HF '15 Client was disconnected before upload was completted. Const xfsErrorBinaryRead = &H10 '16 Unexpected error from Request.BinaryRead method (ASP error). 'This class emulates ASPForm Class of Huge-ASP upload, http://upload.Motobit.cz 'See ScriptUtilities and Huge-ASP file upload help (ScptUtl.chm) Class ASPForm Private m_ReadTime Public ChunkReadSize, BytesRead, TotalBytes, UploadID 'non-used properties. Public TempPath, MaxMemoryStorage, CharSet, FormType, SourceData, ReadTimeout public Default Property Get Item(Key) Read Set Item = m_Items.Item(Key) End Property public Property Get Items Read Set Items = m_Items End Property public Property Get Files Read Set Files = m_Items.Files End Property public Property Get Texts Read Set Texts = m_Items.Texts End Property public Property Get NewUploadID Randomize NewUploadID = clng(rnd * &H7FFFFFFF) End Property Public Property Get ReadTime if isempty(m_ReadTime) then if not isempty(StartUploadTime) then ReadTime = Clng((Now() - StartUploadTime) * 86400 * 1000) else ' For progress window. ReadTime = m_ReadTime end if End Property Public Property Get State if m_State = xfsNone Then Read State = m_State End Property Private Function CheckRequestProperties 'Wscript.Echo "**CheckRequestProperties" If UCase(Request.ServerVariables("REQUEST_METHOD")) <> "POST" Then 'Request method must be "POST" m_State = xfsNotPost Exit Function End If 'If Request.ServerVariables("REQUEST_METHOD") = "POST" Then Dim CT CT = Request.ServerVariables("HTTP_Content_Type") 'reads Content-Type header if len(CT) = 0 then CT = Request.ServerVariables("CONTENT_TYPE") 'reads Content-Type header UNIX/Linux If LCase(Left(CT, 19)) <> "multipart/form-data" Then 'Content-Type header must be "multipart/form-data" m_State = xfsUnknownType Exit Function End If 'If LCase(Left(CT, 19)) <> "multipart/form-data" Then Dim PosB 'help position variable 'This is upload request. 'Get the boundary and length from Content-Type header PosB = InStr(LCase(CT), "boundary=") 'Finds boundary If PosB = 0 Then m_State = xfsNoBoundary Exit Function End If 'If PosB = 0 Then If PosB > 0 Then Boundary = Mid(CT, PosB + 9) 'Separetes boundary '****** Error of IE5.01 - doubbles http header PosB = InStr(LCase(CT), "boundary=") If PosB > 0 then 'Patch for the IE error PosB = InStr(Boundary, ",") If PosB > 0 Then Boundary = Left(Boundary, PosB - 1) end if '****** Error of IE5.01 - doubbles http header On Error Resume next TotalBytes = Request.TotalBytes If Err<>0 Then 'For UNIX/Linux TotalBytes = CLng(Request.ServerVariables("HTTP_Content_Length")) 'Get Content-Length header if len(TotalBytes)=0 then TotalBytes = CLng(Request.ServerVariables("CONTENT_LENGTH")) 'Get Content-Length header End If If TotalBytes = 0 then m_State = xfsZeroLength Exit Function End If If IsInSizeLimit(TotalBytes) Then 'Form data are in allowed limit CheckRequestProperties = True m_State = xfsInProgress Else 'Form data are in allowed limit 'Form data exceeds the limit. m_State = xfsSizeLimit End if 'Form data are in allowed limit End Function 'reads source data using BinaryRead and store them in SourceData stream Public Sub Read() if m_State <> xfsNone Then Exit Sub 'Wscript.Echo "**Read" If Not CheckRequestProperties Then WriteProgressInfo Exit Sub End If 'Initialize binary store stream if isempty(bSourceData) then Set bSourceData = createobject("ADODB.Stream") bSourceData.Open bSourceData.Type = 1 'Binary 'Initialize Read variables. Dim DataPart, PartSize BytesRead = 0 StartUploadTime = Now 'read source data stream in chunks of ChunkReadSize Do While BytesRead < TotalBytes 'Read chunk of data PartSize = ChunkReadSize if PartSize + BytesRead > TotalBytes Then PartSize = TotalBytes - BytesRead DataPart = Request.BinaryRead(PartSize) BytesRead = BytesRead + PartSize 'Wscript.Echo PartSize 'Store the part size in our stream bSourceData.Write DataPart 'Write progress info for secondary window. WriteProgressInfo 'Check if the client is still connected If Not Response.IsClientConnected Then m_State = xfsNoConnected Exit Sub End If Loop m_State = xfsCompleted 'We have all source data in bSourceData stream ParseFormData End Sub Private Sub ParseFormData Dim Binary bSourceData.Position = 0 Binary = bSourceData.Read 'wscript.echo "Binary", LenB(Binary) m_Items.mpSeparateFields Binary, Boundary End Sub 'This function reads progress info data from a temporary file. Public Function getForm(FormID) if isempty(ProgressFile.UploadID) Then 'Was UploadID of ProgressFile set? ProgressFile.UploadID = FormID End If 'Get progress data Dim ProgressData ProgressData = ProgressFile if len(ProgressData) > 0 then 'There are some progress data if ProgressData = "DONE" Then 'Upload was done. ProgressFile.Done Err.Raise 1, "getForm", "Upload was done" Else ' if ProgressData = "DONE" Then 'Upload was done. 'm_State & vbCrLf & TotalBytes & vbCrLf & BytesRead & vbCrLf & ReadTime ProgressData = Split (ProgressData, vbCrLf) if ubound(ProgressData) = 3 Then m_State = clng(ProgressData(0)) TotalBytes = clng(ProgressData(1)) BytesRead = clng(ProgressData(2)) m_ReadTime = clng(ProgressData(3)) End If'if ubound(ProgressData) = 3 Then End If'if ProgressData = "DONE" Then 'Upload was done. end if'if len(ProgressData) > 0 then 'There are some progress data Set getForm = Me End Function 'This function writes progress info data to a temporary file. Private Sub WriteProgressInfo If UploadID > 0 Then ' Is the upload ID defined? (Upload is using progress) if isempty(ProgressFile.UploadID) Then 'Was UploadID of ProgressFile set? ProgressFile.UploadID = UploadID End If Dim ProgressData, FileName ProgressData = m_State & vbCrLf & TotalBytes & vbCrLf & BytesRead & vbCrLf & ReadTime ProgressFile.Contents = ProgressData End If End Sub 'ASPForm Constructor Private Sub Class_Initialize() ChunkReadSize = &H10000 '64 kB SizeLimit = &H100000 '1MB BytesRead = 0 m_State = xfsNone TotalBytes = Request.TotalBytes Set ProgressFile = New cProgressFile Set m_Items = New cFormFields End Sub 'ASPForm Destructor Private Sub Class_Terminate() If UploadID > 0 Then ' Is the upload ID defined? (Upload is using progress) 'We have to close info about upload. ProgressFile.Contents = "DONE" End If End Sub Private Function IsInSizeLimit(TotalBytes) IsInSizeLimit = (m_SizeLimit = 0 or m_SizeLimit > TotalBytes) and (MaxLicensedLimit > TotalBytes) End Function Public Property Get SizeLimit SizeLimit = m_SizeLimit End Property 'Pure - ASP upload is a free script, but with 10MB upload limit ' if you want to upload bigger files, please register ScriptUtilities and Huge-ASP upload ' at http://www.motobit.com/help/scptutl/lc2.htm Public Property Let SizeLimit(NewLimit) if NewLimit > MaxLicensedLimit Then Err.Raise 1, "ASPForm - SizeLimit", "This version of Pure-ASP upload is licensed with maximum limit of 10MB (" & MaxLicensedLimit & "B)" m_SizeLimit = MaxLicensedLimit Else m_SizeLimit = NewLimit end if End Property Public Boundary Private m_Items Private m_State Private m_SizeLimit 'Defined form size limit. Private bSourceData 'ADODB.Stream Private StartUploadTime , TempFiolder Private ProgressFile 'File with info about current progress End Class 'ASPForm Const MaxLicensedLimit = &HA00000 '************************************************************************ 'Emulates ScriptUtilities FormFields object 'We must have such class because of multiselect fields. 'See http://www.motobit.com Class cFormFields Dim m_Keys() Dim m_Items() Dim m_Count Public Default Property Get Item(ByVal Key) If vartype(Key) = vbInteger or vartype(Key) = vbLong then 'Numeric index if Key<1 or Key>m_Count Then Err.raise "Index out of bounds" Set Item = m_Items(Key-1) Exit Property end if 'wscript.echo "**Item", Key Dim Count Count = ItemCount(Key) Key = LCase(Key) If Count > 0 then If Count>1 Then 'More items 'Get them All as an cFormFields Dim OutItem, ItemCounter Set OutItem = New cFormFields ItemCounter = 0 For ItemCounter = 0 To Ubound(m_Keys) If LCase(m_Keys(ItemCounter)) = Key then OutItem.Add Key, m_Items(ItemCounter) Next Set Item = OutItem 'wscript.echo "***Item-More", Key Else For ItemCounter = 0 To Ubound(m_Keys) If LCase(m_Keys(ItemCounter)) = Key then exit for Next if isobject (m_Items(ItemCounter)) then Set Item = m_Items(ItemCounter) else Item = m_Items(ItemCounter) end if 'wscript.echo "***Item-One", Key End If Else'No item Set Item = New cFormField End if End Property Public Property Get MultiItem(ByVal Key) 'returns an array of items with the same Key Dim Out: Set Out = New cFormFields Dim I, vItem Dim Count Count = ItemCount(Key) if Count = 1 then 'one key - get it from Item Out.Add Key, Item(Key) elseif Count > 1 then 'more keys - enumerate them using Items For Each I In Item(Key).Items Out.Add Key, I Next End If Set MultiItem = Out End Property 'For multiitem (I'm sorry, VBS does not support optional parameters for Item property) Public Property Get Value Dim I, V For Each I in m_Items V = V & ", " & I Next V = Mid(V, 3) Value = V End Property Public Property Get xA_NewEnum Set xA_NewEnum = m_Items End Property Public Property Get Items() 'Wscript.Echo "**cFormFields-Items" Items = m_Items End Property Public Property Get Keys() Keys = m_Keys End Property public Property Get Files Dim cItem, OutItem, ItemCounter Set OutItem = New cFormFields ItemCounter = 0 if m_Count > 0 then ' Enumerate only non-empty form For ItemCounter = 0 To Ubound(m_Keys) Set cItem = m_Items(ItemCounter) if cItem.IsFile then OutItem.Add m_Keys(ItemCounter), m_Items(ItemCounter) end if Next End If Set Files = OutItem End Property Public Property Get Texts Dim cItem, OutItem, ItemCounter Set OutItem = New cFormFields ItemCounter = 0 For ItemCounter = 0 To Ubound(m_Keys) Set cItem = m_Items(ItemCounter) if Not cItem.IsFile then OutItem.Add m_Keys(ItemCounter), m_Items(ItemCounter) end if Next Set Texts = OutItem End Property Public Sub Save(Path) Dim Item For Each Item In m_Items If Item.isFile Then Item.Save Path End If Next End Sub 'Count of dictionary items within specified key Public Property Get ItemCount(ByVal Key) 'wscript.echo "ItemCount" Dim cKey, Counter Counter = 0 Key = LCase(Key) For Each cKey In m_Keys 'wscript.echo "ItemCount", "cKey" If LCase(cKey) = Key then Counter = Counter + 1 Next ItemCount = Counter End Property 'Count of all dictionary items Public Property Get Count() Count = m_Count End Property Public Sub Add(byval Key, Item) Key = "" & Key ReDim Preserve m_Items(m_Count) ReDim Preserve m_Keys(m_Count) m_Keys(m_Count) = Key Set m_Items(m_Count) = Item m_Count = m_Count + 1 End Sub Private Sub Class_Initialize() Dim vHelp() ' I do not know why, but some of VBS verrsions declares m_Items and m_Keys as Empty, ' not as Variant() - see class variables. ' vHelp eliminates this problem. V. 2.03, 2.04 On Error Resume Next m_Items = vHelp m_Keys = vHelp m_Count = 0 End Sub '********************************** mpSeparateFields ********************************** 'This method retrieves the upload fields from binary data 'Binary is safearray ( VT_UI1 | VT_ARRAY ) of all multipart document raw binary data from input. Public Sub mpSeparateFields(Binary, ByVal Boundary) Dim PosOpenBoundary, PosCloseBoundary, PosEndOfHeader, isLastBoundary Boundary = "--" & Boundary Boundary = StringToBinary(Boundary) PosOpenBoundary = InStrB(Binary, Boundary) PosCloseBoundary = InStrB(PosOpenBoundary + LenB(Boundary), Binary, Boundary, 0) Do While (PosOpenBoundary > 0 And PosCloseBoundary > 0 And Not isLastBoundary) 'Header and file/source field data Dim HeaderContent, bFieldContent 'Header fields Dim Content_Disposition, FormFieldName, SourceFileName, Content_Type 'Helping variables Dim TwoCharsAfterEndBoundary 'Get end of header PosEndOfHeader = InStrB(PosOpenBoundary + Len(Boundary), Binary, StringToBinary(vbCrLf + vbCrLf)) 'Separates field header HeaderContent = MidB(Binary, PosOpenBoundary + LenB(Boundary) + 2, PosEndOfHeader - PosOpenBoundary - LenB(Boundary) - 2) 'Separates field content bFieldContent = MidB(Binary, (PosEndOfHeader + 4), PosCloseBoundary - (PosEndOfHeader + 4) - 2) 'Separates header fields from header GetHeadFields BinaryToString(HeaderContent), FormFieldName, SourceFileName, Content_Disposition, Content_Type 'Create one field and assign parameters Dim Field 'All field values. Set Field = New cFormField Field.ByteArray = MultiByteToBinary(bFieldContent) Field.Name = FormFieldName Field.ContentDisposition = Content_Disposition if not isempty(SourceFileName) then Field.FilePath = SourceFileName Field.FileName = GetFileName(SourceFileName) Field.FileExt = GetFileExt(SourceFileName) else'if not isempty(SourceFileName) then End If'if not isempty(SourceFileName) then Field.ContentType = Content_Type Add FormFieldName, Field 'Is this last boundary ? TwoCharsAfterEndBoundary = BinaryToString(MidB(Binary, PosCloseBoundary + LenB(Boundary), 2)) isLastBoundary = TwoCharsAfterEndBoundary = "--" If Not isLastBoundary Then 'This is not last boundary - go to next form field. PosOpenBoundary = PosCloseBoundary PosCloseBoundary = InStrB(PosOpenBoundary + LenB(Boundary), Binary, Boundary) End If Loop End Sub End Class 'cFormFields 'This class transfers data between primary (upload) and secondary (progress) window. Class cProgressFile Private fs Public TempFolder Public m_UploadID Public TempFileName Public Default Property Get Contents() Contents = GetFile(TempFileName) End Property Public Property Let Contents(inContents) WriteFile TempFileName, inContents End Property Public Sub Done 'Delete temporary file when upload was done. FS.DeleteFile TempFileName End Sub Public Property Get UploadID() UploadID = m_UploadID End Property Public Property Let UploadID(inUploadID) if isempty(FS) then Set fs = CreateObject("Scripting.FileSystemObject") TempFolder = fs.GetSpecialFolder(2) m_UploadID = inUploadID TempFileName = TempFolder & "\pu" & m_UploadID & ".~tmp" Dim DateLastModified on error resume next DateLastModified = fs.GetFile(TempFileName).DateLastModified on error goto 0 if isempty(DateLastModified) then 'OK elseif Now-DateLastModified>1 Then 'I think upload duration will be less than one day FS.DeleteFile TempFileName end if End Property Private Function GetFile(Byref FileName) Dim InStream On Error Resume Next Set InStream = fs.OpenTextFile(FileName, 1) GetFile = InStream.ReadAll On Error Goto 0 End Function Private Function WriteFile(Byref FileName, Byref Contents) 'wscript.echo "WriteFile", FileName, Contents Dim OutStream On Error Resume Next Set OutStream = fs.OpenTextFile(FileName, 2, True) OutStream.Write Contents End Function Private Sub Class_Initialize() End Sub End Class 'cProgressFile '****************************************************************************** 'Emulates ScriptUtilities FormField object 'See http://www.motobit.com Class cFormField 'Used properties Public ContentDisposition, ContentType, FileName, FilePath, FileExt, Name Public ByteArray 'non-used properties. Public CharSet, HexString, InProgress, SourceLength, RAWHeader, Index, ContentTransferEncoding Public Default Property Get String() 'wscript.echo "**Field-String", Name, LenB(ByteArray) String = BinaryToString(ByteArray) End Property Public Property Get IsFile() IsFile = not isempty(FileName) End Property Public Property Get Length() Length = LenB(ByteArray) End Property Public Property Get Value() Set Value = Me End Property Public Sub Save(Path) '2.06 - and len(FileName)>0 if IsFile and len(FileName)>0 Then Dim fullFileName fullFileName = Path & "\" & FileName SaveAs fullFileName Else 'response.write "
" & typename(Name) 'Err.Raise 1, "Text field " & Name & " does not have a file name" End If End Sub Public Sub SaveAs(newFileName) '2.06 - removed if len(ByteArray)>0 then SaveBinaryData newFileName, ByteArray End Sub End Class Function StringToBinary(String) Dim I, B For I=1 to len(String) B = B & ChrB(Asc(Mid(String,I,1))) Next StringToBinary = B End Function Function BinaryToString(Binary) '2001 Antonin Foller, Motobit Software 'Optimized version of PureASP conversion function 'Selects the best algorithm to convert binary data to String data Dim TempString On Error Resume Next 'Recordset conversion has a best functionality TempString = RSBinaryToString(Binary) If Len(TempString) <> LenB(Binary) then'Conversion error 'We have to use multibyte version of BinaryToString TempString = MBBinaryToString(Binary) end if BinaryToString = TempString End Function Function MBBinaryToString(Binary) '1999 Antonin Foller, Motobit Software 'MultiByte version of BinaryToString function 'Optimized version of simple BinaryToString algorithm. dim cl1, cl2, cl3, pl1, pl2, pl3 Dim L', nullchar cl1 = 1 cl2 = 1 cl3 = 1 L = LenB(Binary) Do While cl1<=L pl3 = pl3 & Chr(AscB(MidB(Binary,cl1,1))) cl1 = cl1 + 1 cl3 = cl3 + 1 if cl3>300 then pl2 = pl2 & pl3 pl3 = "" cl3 = 1 cl2 = cl2 + 1 if cl2>200 then pl1 = pl1 & pl2 pl2 = "" cl2 = 1 End If End If Loop MBBinaryToString = pl1 & pl2 & pl3 End Function Function RSBinaryToString(xBinary) '1999 Antonin Foller, Motobit Software 'This function converts binary data (VT_UI1 | VT_ARRAY or MultiByte string) 'to string (BSTR) using ADO recordset 'The fastest way - requires ADODB.Recordset 'Use this function instead of MBBinaryToString if you have ADODB.Recordset installed 'to eliminate problem with PureASP performance Dim Binary 'MultiByte data must be converted to VT_UI1 | VT_ARRAY first. if vartype(xBinary) = 8 then Binary = MultiByteToBinary(xBinary) else Binary = xBinary Dim RS, LBinary Const adLongVarChar = 201 Set RS = CreateObject("ADODB.Recordset") LBinary = LenB(Binary) if LBinary>0 then RS.Fields.Append "mBinary", adLongVarChar, LBinary RS.Open RS.AddNew RS("mBinary").AppendChunk Binary RS.Update RSBinaryToString = RS("mBinary") Else RSBinaryToString = "" End If End Function Function MultiByteToBinary(MultiByte) ' This function converts multibyte string to real binary data (VT_UI1 | VT_ARRAY) ' Using recordset Dim RS, LMultiByte, Binary Const adLongVarBinary = 205 Set RS = CreateObject("ADODB.Recordset") LMultiByte = LenB(MultiByte) if LMultiByte>0 then RS.Fields.Append "mBinary", adLongVarBinary, LMultiByte RS.Open RS.AddNew RS("mBinary").AppendChunk MultiByte & ChrB(0) RS.Update Binary = RS("mBinary").GetChunk(LMultiByte) End If MultiByteToBinary = Binary End Function '************** Upload Utilities 'Separates header fields from upload header Function GetHeadFields(ByVal Head, Name, FileName, Content_Disposition, Content_Type) 'Get name of the field. Name is separated by name= and ; Name = (SeparateField(Head, "name=", ";")) 'ltrim 'Remove quotes (if the field name is quoted) If Left(Name, 1) = """" Then Name = Mid(Name, 2, Len(Name) - 2) 'Same for source filename FileName = (SeparateField(Head, "filename=", ";")) 'ltrim If Left(FileName, 1) = """" Then FileName = Mid(FileName, 2, Len(FileName) - 2) 'Separate content-disposition and content-type header fields Content_Disposition = LTrim(SeparateField(Head, "content-disposition:", ";")) Content_Type = LTrim(SeparateField(Head, "content-type:", ";")) End Function 'Separates one field between sStart and sEnd Function SeparateField(From, ByVal sStart, ByVal sEnd) Dim PosB, PosE, sFrom sFrom = LCase(From) PosB = InStr(sFrom, sStart) If PosB > 0 Then PosB = PosB + Len(sStart) PosE = InStr(PosB, sFrom, sEnd) If PosE = 0 Then PosE = InStr(PosB, sFrom, vbCrLf) If PosE = 0 Then PosE = Len(sFrom) + 1 SeparateField = Mid(From, PosB, PosE - PosB) Else SeparateField = Empty End If End Function Function SplitFileName(FullPath) Dim Pos, PosF PosF = 0 For Pos = Len(FullPath) To 1 Step -1 Select Case Mid(FullPath, Pos, 1) Case ":", "/", "\": PosF = Pos + 1: Pos = 0 End Select Next If PosF = 0 Then PosF = 1 SplitFileName = PosF End Function Function GetPath(FullPath) GetPath = left(FullPath, SplitFileName(FullPath)-1) End Function 'Separetes file name from the full path of file Function GetFileName(FullPath) GetFileName = Mid(FullPath, SplitFileName(FullPath)) End Function 'Separetes file name from the full path of file Function GetFileExt(FullPath) Dim Pos: Pos = InStrRev(FullPath,".") if Pos>0 then GetFileExt = Mid(FullPath, Pos) End Function Function RecurseMKDir(ByVal Path) Dim FS: Set FS = CreateObject("Scripting.FileSystemObject") Path = Replace(Path, "/", "\") If Right(Path, 1) <> "\" Then Path = Path & "\" '" Dim Pos, n Pos = 0: n = 0 Pos = InStr(Pos + 1, Path, "\") '" Do While Pos > 0 On Error Resume Next FS.CreateFolder Left(Path, Pos - 1) If Err = 0 Then n = n + 1 Pos = InStr(Pos + 1, Path, "\") '" Loop RecurseMKDir = n End Function Function SaveBinaryData(FileName, ByteArray) SaveBinaryData = SaveBinaryDataStream(FileName, ByteArray) End Function Function SaveBinaryDataTextStream(FileName, ByteArray) Dim FS : Set FS = CreateObject("Scripting.FileSystemObject") On error Resume next Dim TextStream Set TextStream = FS.CreateTextFile(FileName) if Err = &H4c then 'Path not found. On error Goto 0 RecurseMKDir GetPath(FileName) On error Resume next Set TextStream = FS.CreateTextFile(FileName) end if TextStream.Write BinaryToString(ByteArray) 'BinaryToString is in upload.inc. TextStream.Close Dim ErrMessage, ErrNumber ErrMessage = Err.Description ErrNumber = Err On Error Goto 0 if ErrNumber<>0 then Err.Raise ErrNumber, "SaveBinaryData", FileName & ":" & ErrMessage End Function Function SaveBinaryDataStream(FileName, ByteArray) Dim BinaryStream Set BinaryStream = createobject("ADODB.Stream") BinaryStream.Type = 1 'Binary BinaryStream.Open '2.06 - zero byte file is legal if lenb(ByteArray)>0 then BinaryStream.Write ByteArray On error Resume next BinaryStream.SaveToFile FileName, 2 'Overwrite if Err = &Hbbc then 'Path not found. On error Goto 0 RecurseMKDir GetPath(FileName) On error Resume next BinaryStream.SaveToFile FileName, 2 'Overwrite end if Dim ErrMessage, ErrNumber ErrMessage = Err.Description ErrNumber = Err On Error Goto 0 if ErrNumber<>0 then Err.Raise ErrNumber, "SaveBinaryData", FileName & ":" & ErrMessage End Function '************** Upload Utilities - end 'Emulates response object Class cResponse Public Property Get IsClientConnected randomize IsClientConnected = cbool(clng(rnd * 4)) IsClientConnected = True End Property End Class Class cRequest Private Readed Private BinaryStream public function ServerVariables(Name) select case UCase(Name) Case "CONTENT_TYPE": Case "HTTP_CONTENT_TYPE": ServerVariables = "multipart/form-data; boundary=---------------------------7d21960404e2" Case "CONTENT_LENGTH": Case "HTTP_CONTENT_LENGTH": ServerVariables = "" & TotalBytes Case "REQUEST_METHOD": ServerVariables = "POST" End Select End Function public function BinaryRead(ByRef Bytes) If Bytes<=0 then Exit Function if Readed + Bytes > TotalBytes Then Bytes = TotalBytes - Readed BinaryRead = BinaryStream.Read(Bytes) End Function Public Property Get TotalBytes TotalBytes = BinaryStream.Size End Property Private Sub Class_Initialize() Set BinaryStream = createobject("ADODB.Stream") BinaryStream.Type = 1 'Binary BinaryStream.Open BinaryStream.LoadFromFile "F:\InetPub\Motobit\pureupload\2.txt" BinaryStream.Position = 0 Readed = 0 End Sub end Class %> <% Server.ScriptTimeout = 2000 Form.SizeLimit = &HA00000 If Form.State = 0 Then 'Completted Dim File, DestFileName For Each File In Form.Files.Items If Len(File.FileName) > 0 Then DestFileName = GetUniqueFileName(File.FileName, DestinationPath) File.SaveAs DestinationPath & "\" & DestFileName End If Next ElseIf Form.State > 10 then Const fsSizeLimit = &HD Select case Form.State case fsSizeLimit: response.write "
Source form size (" & Form.TotalBytes & "B) exceeds form limit (" & Form.SizeLimit & "B)
" case else response.write "
Some form error.
" end Select End If'Form.State = 0 then Dim gFS Function GetUniqueFileName(FileName, DestPath) if isempty(gFS) then Set gFS = CreateObject("Scripting.FileSystemObject") Dim Counter, FullPath, NewFileName Counter = 1 NewFileName = FileName if gFS.FileExists(DestPath & "\" & NewFileName) then Do Counter = Counter + 1 NewFileName = Counter & "-" & FileName Loop while gFS.FileExists(DestPath & "\" & NewFileName) end if GetUniqueFileName = NewFileName End Function %> The Best Talents

.
          Tip 4 Job-Seekers

The more NOs you get out of the way it means you are getting closer to a YES!
Get up and start getting more
NOs out of the way.

                    Select

               What's New

    Join us
as an
Affiliate

THE BEST TALENTS.COM :: Terms of Use

1. Introduction. Please read this web page carefully. It contains the Terms and Conditions governing your access to and use of the TBT India Web Site. If you do not accept these Terms and Conditions or you do not meet or comply with their provisions, you may not use the Site. If you are an employer using the Site, you may have entered into a Service Agreement with TBT India, in which case these Terms and Conditions, including the Exhibits attached hereto, are part of and incorporated into that Service Agreement. These Terms and Conditions are effective as of April 1, 2007.

2. Binding Agreement. These Terms and Conditions, together with all Exhibits to these Terms and Conditions (as they may be amended from time to time by TBT India) form a binding agreement (the "Agreement") between you and TBT, LLC. Your access to or use of the Site indicates your acceptance of these Terms and Conditions. You are agreeing to use the Site at your own risk.

3. Certain Definitions. The following definitions apply to this Agreement:
"thebesttalents.com Web Site", or the "Site", includes www.thebesttalents.com in its entirety and its related sites owned or operated by TBT India, and includes their Content, Text, Graphics, Design, Programming and Services as applicable in the context.
"Content" includes all Text, Graphics, Design and Programming used on the Site.
"Text" includes all text on every page of the Site, whether editorial, navigational, or instructional.
"Graphics" includes all logos, buttons, and other graphical elements on the Site, with the exception of paid advertising banners.
"Design" includes the color combinations and the page layout of the Site.
"Programming" includes both client-side code (HTML, JavaScript, etc.) and server-side code (Active Server Pages, VBScript, databases, etc.) used on the Site.
"Document" refers to any posting to the Site, whether job or cv.
"Services" means any services provided on the Site by TBT India or its agents.
"User" refers to any individual or entity who uses any aspect of the Site.
"Job Seeker" means a User who is accessing the Site to search for a job or in any other capacity except as an Employer.
"Employer" means a person or entity that is accessing the Site to post a job or for any reason related to the purpose of seeking candidates for employment.
"You" and "you" means the person who (or the entity on behalf of whom you are acting) that is agreeing to these Terms and Conditions.

4. Acceptable Use of the Site.

4.1 General Use Rules. The Site is intended for individuals seeking employment and for employers or recruiters seeking candidates for employment. You may use this Site only for lawful purposes within the stated context of TBT India's intended and acceptable use of the Site. TBT India is the sole interpreter of the Site’s intended and acceptable use.

4.2 License to Use by Users who are Job Seekers. TBT India hereby grants you a limited, terminable, non-exclusive right to access and use the Site only for your personal use seeking employment opportunities for yourself. This authorizes you to view and download a single copy of the material on the Site solely for your personal, noncommercial use. You agree that you are solely responsible for the content of any Document you post to the Site and any consequences arising from such posting. Your use of the Site is a privilege. TBT India reserves the right to suspend or terminate that privilege for any reason at any time, in its sole discretion.

4.3 License to Use by Users who are employers. TBT India hereby grants you a limited, terminable, non-exclusive right to access and use the Site only for your internal business use seeking candidates for employment. This authorizes you to view and download a single copy of the material on the Site solely for your personal use directly related to using the Site for the purpose of searching and recruiting job prospects. Users of the CV Database please see our CV Database Terms and Conditions for further clarification. You agree that you are solely responsible for the content of any Document you post to the Site and any consequences arising from such posting. TBT India reserves the right to suspend or terminate your access and use at any time if TBT India determines that you are in breach of any of these Terms and Conditions.

4.4 Other Specific Rules. You represent, warrant and agree that you will not use (or plan, encourage or help others to use) the Site for any purpose or in any manner that is prohibited by these Terms and Conditions or by applicable law. It is your responsibility to ensure that your use of the Site complies with these Terms and Conditions and all applicable laws.

4.5 House Rules for Posting, Conduct and Security. You agree to comply with the "House Rules" for posting, conduct and security on the Site, which are attached hereto as Exhibit A.

5. Intellectual Property Rights. The Site and all right, title and interest in and to the Site is the sole property of TBT India or its licensors, and is protected by U.S. copyright and international treaties. Except for the limited licenses expressly granted to you in these Terms and Conditions, TBT India reserves for itself and its licensors all other right, title and interest. Without limitation on the foregoing, you may not reproduce, modify, display, sell, or distribute the Content, or use it in any other way for public or commercial purpose. This includes copying or adapting the HTML code used to generate Web pages on the Site. "TBT India," the TBT India design logo and certain other names or logos are service marks or trademarks of TBT India, and all related product and service names, design marks and slogans are the service marks or trademarks of TBT India. In addition, the "look" and "feel" of the Site (including color combinations, button shapes, layout, design and all other graphical elements) are also protected by TBT India's trademarks, service marks and copyrights. All other product and service marks contained on the Site are the trademarks of their respective owners.

6. Disclaimers and Limitations on TBT's Liability.

6.1 Allocation of Responsibility TBT India assumes no responsibility for Documents posted by Users and no responsibility for the activities, omissions or other conduct of Users. TBT India acts as a portal for the online distribution and publication of User submitted information and has no obligation to screen communications or information in advance and is not responsible for screening or monitoring Documents posted by Users. If notified by a User of a Document which allegedly does not conform to this agreement, TBT India may investigate the allegation and determine in good faith and in its sole discretion whether to remove or request the removal of such Document. TBT India has no liability or responsibility to Users for performance or nonperformance of such activities. TBT India may take any action with respect to User submitted information that it deems necessary or appropriate, in its sole discretion.

6.2 No endorsements by TBT India. Nothing on the Site shall be considered an endorsement, representation or warranty with respect to any User or third party, whether in regards to its web site, products, services, hiring, experience, employment or recruiting practices, or otherwise.

6.3 No Guaranty of Results. TBT India is not an employment agency or a recruiting firm, and makes no representations or guarantees regarding the effectiveness or timeliness of the Site in meeting the employment objectives of Users. TBT India does not guarantee that Documents posted by Users will result in candidates being hired or positions being filled, and is not responsible for any employment decisions, for whatever reason made, made by any User.

6.4 WARRANTY DISCLAIMERS
(a) THE SITE IS PROVIDED ON AN 'AS IS' BASIS WITHOUT ANY WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED. TBT INDIA, TO THE FULLEST EXTENT PERMITTED BY LAW, DISCLAIMS ALL WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT OF THIRD PARTIES’ RIGHTS, AND FITNESS FOR PARTICULAR PURPOSE. TBT INDIA MAKES NO WARRANTIES ABOUT THE ACCURACY, RELIABILITY, COMPLETENESS, OR TIMELINESS OF THE SITE.
(b) Without limitation on the foregoing:
(i) TBT INDIA DOES NOT WARRANT THAT THE SITE WILL OPERATE ERROR-FREE OR THAT THE SITE AND ITS SERVERS ARE FREE OF COMPUTER VIRUSES OR OTHER HARMFUL MECHANISMS. IF YOUR USE OF THE SITE RESULTS DIRECTLY OR INDIRECTLY IN THE NEED FOR SERVICING OR REPLACING EQUIPMENT OR DATA, TBT INDIA IS NOT RESPONSIBLE FOR THOSE COSTS.
(ii) TBT India makes no representations or guarantees regarding the truthfulness, accuracy, completeness, timeliness or reliability of any Documents posted by Users, or of any other form of communication engaged in by Users. Documents may contain inaccuracies or typographical errors. You agree that any reliance on Documents posted by Users, or on any other form of communication with Users, will be at your own risk.
(iii) TBT India makes no representations or guarantees regarding the Content of the Site, including, but not limited to, broken links, inaccuracies or typographical errors.

6.5 DAMAGE LIMITATIONS, ALLOCATIONS OF LIABILITY AND EQUITABLE RELIEF.
(a) YOU ASSUME ALL RESPONSIBILITY AND RISK FOR YOUR USE OF THE SITE, THE INTERNET GENERALLY, AND THE DOCUMENTS YOU POST OR ACCESS AND FOR YOUR CONDUCT ON AND OFF THE SITE.
(b) IN NO EVENT SHALL TBT INDIA (OR ANY OF ITS OFFICERS, DIRECTORS, SHAREHOLDERS, EMPLOYEES, AFFILIATES, AGENTS OR ADVERTISERS), BE LIABLE FOR ANY NON-DIRECT DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, INCIDENTAL AND CONSEQUENTIAL DAMAGES, LOST PROFITS, OR DAMAGES RESULTING FROM LOST DATA, LOST EMPLOYMENT OPPORTUNITY, OR BUSINESS INTERRUPTION) RESULTING FROM OR ARISING UNDER OR IN CONNECTION WITH THE USE OR ACCESS TO, OR THE INABILITY TO USE OR ACCESS, THE SITE AND/OR ANY DOCUMENT, WHETHER BASED ON WARRANTY, CONTRACT, TORT, OR ANY OTHER LEGAL THEORY, AND WHETHER OR NOT TBT INDIA IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
(c) BECAUSE SOME STATES OR JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OR LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES, THE LIMITATIONS SET FORTH IN THE PRECEDING PARAGRAPH MAY NOT APPLY TO YOU. IF ANY ARE HELD INAPPLICABLE OR UNENFORCEABLE FOR ANY REASON, THEN TBT INDIA'S MAXIMUM LIABILITY TO YOU FOR ANY NON-DIRECT TYPE OF DAMAGES SHALL BE LIMITED TO U.S. $200.00 IN THE AGGREGATE.
(d) IN NO EVENT SHALL TBT INDIA (OR ANY OF ITS OFFICERS, DIRECTORS, SHAREHOLDERS, EMPLOYEES, AFFILIATES, AGENTS OR ADVERTISERS), BE LIABLE FOR ANY DIRECT DAMAGES IN EXCESS IN THE AGGREGATE OF US$200.00 (OR, IF YOU ARE AN EMPLOYER WITH A SERVICES AGREEMENT WITH TBT INDIA, THE AMOUNTS ACTUALLY PAID BY YOU TO TBT INDIA UNDER THIS AGREEMENT IF GREATER THAN US$200.00).
(e) Due to the nature of this Agreement, in addition to money damages, you agree that TBT India will be entitled to equitable relief upon a breach of this agreement by you.

7. Payment of Services upon Termination of Service Agreement. If at any time during the course of this Agreement you should terminate a Service Agreement in which these Terms and Conditions have been incorporated by reference, not to include your termination in the case of breach of this Agreement or the Service Agreement by TBT India, TBT India shall reserve the right to receive all payments from you for the Services used by you up to termination and for fifty percent (50%) of the remaining unused portion of the Service Agreement.

8. Links to Other Sites. TBT India contains links to third party web sites. These links are provided solely as a convenience to you and not as an endorsement by TBT India of the contents on such third-party web sites. TBT India is not responsible for the content of linked third-party sites and does not make any representations regarding the content or accuracy of materials on such third-party web sites. If you decide to access linked third-party web sites, you do so at your own risk.

9. Amendments to this Agreement and Changes to Site. TBT India may revise this Agreement at any time by updating this page. Changes will be binding on you on the date they are posted on the Site (or as otherwise stated in the any notice of such changes). Any use of the Site will be considered acceptance by you of the then-current Terms and Conditions (including any Exhibits thereto). If at any time you find the Terms and Conditions unacceptable, you may not use the Site any longer. Any new or different terms supplied by you are specifically rejected by TBT India unless TBT India agrees to them in a signed writing specifically including those new or different terms. TBT India may change the Site at any time.

10. Indemnity. You agree to defend, indemnify, and hold harmless TBT India (and its officers, directors, employees and agents) from and against any third party claims, actions or demands (including, without limitation, costs, damages and reasonable legal and accounting fees) alleging or resulting from or in connection with your use of the Site, any Document posted by you, or your breach of this Agreement. TBT India shall use reasonable efforts to provide you prompt notice of any such claim, suit, or proceeding and may assist you, at your expense, in defending any such claim, suit or proceeding.

11. User Information. The Privacy Policy posted on the Site is incorporated into this Agreement by this reference. The Privacy Policy governs data collected through TBT India’s on-line operations only. Please note, as set forth in the Privacy Policy, that TBT India may collect certain personal information from Users and may contact Users periodically in accordance with the terms of the Privacy Policy. In addition, TBT India reserves the right to comply, in its sole discretion, with legal requirements, requests from law enforcement agencies or requests from government entities, even to the extent that such compliance may require disclosure of certain information collected from Users.

12. Questions and Notices. Questions concerning the use of the Site should be directed to Feedback. Notices shall be sent, for TBT India, to the address listed on the Site, and, for you, to the address submitted by you or such other address as TBT India reasonably determines is an appropriate address for you.

13. General. TBT India contact information is listed on the Site. The TBT India makes no claims that the Content is appropriate or may be downloaded outside of the United States. Access to the Content may not be legal by certain persons or in certain countries, and such persons have no right to access or use the Site. If you access TBT India from outside of the United States, you do so at your own risk and are responsible for compliance with the laws of your jurisdiction. This Agreement and your Service Agreement, if you have one, are governed by the internal substantive laws of the State of Illinois, without respect to its conflict of laws principles. Jurisdiction for any claims arising under this Agreement or your Service Agreement shall lie exclusively with the state or federal courts in the State of Illinois. The sole relationship between You and TBT India is that of independent contractors. If any provision of this Agreement is found to be invalid by any court having competent jurisdiction, the invalidity of all or part of a provision shall not affect the validity of the remaining parts and provisions of this Agreement, which shall remain in full force and effect. All provisions of this Agreement shall survive termination except those granting access or use to the Site, and you shall cease all your use and access thereof immediately. You may not assign or transfer your obligations under this Agreement. No waiver of any term of this Agreement shall be deemed a further or continuing waiver of such term or any other term. Except as expressly provided by TBT India in a particular "Legal Notice," or software license or material on particular Web pages of the Site, this Agreement and your Service Agreement where applicable, constitute the entire agreement between you and TBT India.

Exhibit A -House Rules regarding Posting, Conduct and Security

TBT India is the sole interpreter of these rules. Users who violate these rules may have their access and use of the Site suspended or terminated, at TBT India's discretion. TBT India reserves the right to change these rules in accordance with the amendment policy in the Terms and Conditions to which this Exhibit A is attached.

A1. Posting Rules:

(a) Your Document may not contain: (i) URLs or links to Web sites (to advertise your company or Web site); (ii) copyrighted material (unless you own the copyright or have the owner's permission to post the copyrighted material); (iii) trade secrets (unless you own them or have the owner's permission to post them); (iv) material that infringes on or misappropriates any other intellectual property rights, or violates the privacy or publicity rights of others; (v) anything that is sexually explicit, obscene, libelous, defamatory, threatening, harassing, abusive, or hateful; or (vi) anything that is embarrassing or offensive to another person or entity.

(b) You may not use your Document(s) to: (i) impersonate another person, living or dead; (ii) post false, inaccurate or misleading information; (iii) post advertisements or solicitations of business (including, but not limited to, Email Processors, Project 21, franchises, "club memberships," distributorships, or anything requiring a monetary investment by the User, including a request for payment to obtain job listings); (iv) post chain letters or pyramid schemes; or (v) post opinions or notices, commercial or otherwise.

(c) Your Document(s) must contain sufficient detail to convey clearly to the User the nature and requirements of the job opportunity, or your qualifications as a candidate for employment. Documents that encourage the User to "email for more details" are not permitted. Documents from any third party charging a fee or restricting complete access to all cv information are prohibited.

(d) Job postings must be individual openings for traditional, W-2 or 1099 employees.

(e) CV postings must contain the accurate cv of a living individual seeking employment on a full-time, part-time, or contractual basis on his or her own behalf.

(f) TBT India is under no obligation to monitor the Documents posted on the Site, but it may monitor Documents at random. Documents found to violate the above Posting Rules may be removed at TBT India's discretion.

A2. Conduct Rules:

(a) You may not respond to postings by other Users in any manner or for any purpose other than that which is expected (i.e., to apply for the job or to initiate further discussion with the candidate). Communications soliciting the employer's business by our competitors are prohibited.

(b) You may not send unsolicited commercial email to Users.

(c) Protect your password. You are responsible for maintaining the confidentiality of your information and password. You are responsible for all uses of your registration, whether or not authorized by you. If others use your password to post inappropriate material on the Site, you risk losing your access to the Site. You agree to notify TBT India immediately of any unauthorized use of your registration and password.

(d) Report inappropriate postings or conduct to Feedback.

(e) You may not delete or revise any material posted by any other person or entity.

(f) If at any time during the term of this agreement TBT India comes to the understanding that you: (i) misled TBT India of your business practices and/or services, or (ii) purchased services that do not represent your precise business, TBT India reserves the right to terminate this agreement.

(g) TBT India is under no obligation to monitor the conduct of its Users, but it may investigate and respond when violations are reported.

A3. Security Rules:

(a) Users are prohibited from violating or attempting to violate the security of the Site, including, without limitation: (i) accessing data not intended for such User or logging into a server or account which the User is not authorized to access; (ii) attempting to probe, scan or test the vulnerability of a system or network or to breach security or authentication measures without proper authorization; (iii) attempting to interfere with service to any User, host or network, including, without limitation, via means of submitting a virus to the Site, overloading, "flooding", "mailbombing" or "crashing"; (iv) sending unsolicited e-mail, including promotions and/or advertising of products or services; (v) forging any TCP/IP packet header or any part of the header information in any e-mail or newsgroup posting. Violations of system or network security may result in civil or criminal liability.

(b) Violation of these Security Rules may result in civil or criminal liability. TBT India will investigate occurrences which may involve such violations and may involve, and cooperate with, law enforcement authorities in prosecuting Users who are involved in such violations.

In case you have any query or want some further information, please E-mail us at:  info@thebesttalents.com

Feedback || Sitemap || Terms & Conditions || Disclaimer

Important: We do not guarantee anyone a job or interview as we are not the hiring organization/company.

.

© 2007 ::  SR-I-Business Consultants