%@language="vbscript"%> <%response.buffer=true%> <%response.expires=0%> <% Dim DestinationPath Dim name1 Dim details Dim Externalpath Dim con_email 'DestinationPath = Server.mapPath("UploadFolder") DestinationPath = Server.mapPath("CV") 'response.Write(DestinationPath) Dim Form: Set Form = New ASPForm 'Server.ScriptTimeout = 2000 Form.SizeLimit = &H100000 If Form.State = 0 Then 'Completted Dim DestFileName Dim File CNTFILES=0 For Each File In Form.Files.Items CNTFILES=CNTFILES+1 If Len(File.FileName) > 0 Then if cntfiles=1 then DestFileName1 = GetUniqueFileName(File.FileName, DestinationPath) File.SaveAs DestinationPath & "\" & DestFileName1 end if end if next End If 'Form.State = 0 then Dim gFS 'creates an unique filename 'in filename.ext, filename-1.ext, filename-2.ext, filename-3.ext, ... schema Function GetUniqueFileName(FileName, DestPath) 'delete the existing file starts here dim deletefilefs,f set deletefilefs=Server.CreateObject("Scripting.FileSystemObject") 'set f=fs.GetFile("c:\theparsidirecotyr\admin\achalproc.txt") if (deletefilefs.FileExists(server.MapPath(".") & "\CV\" & "&filename&"))=true then set f=fs.GetFile(server.MapPath(".") & "\CV\" & "&filename&") Response.Write ((server.MapPath(".") & "\CV\" & "&filename&")) f.Delete set f=nothing set deletefilefs=nothing end if 'delete the existing file ends here GetUniqueFileName = FileName End Function %> <% if Form("submit")="Apply" then bSuccess = false title=Form("title") firstname=Form("firstName") lastName=Form("lastName") address=Form("address") email=Form("email") txtstd=Form("txtstd") txtphone=Form("txtphone") txtmobile=Form("txtmobile") ccomp=Form("ccomp") csalary=Form("csalary") file1=Form("file1") ''------------------------------- HTML: BODY ------------------------------------- mbody = "" mbody="
" mbody=mbody&"
|
|