Rank: Member
Groups: Joined: 8/23/2006(UTC) Posts: 1
|
here is my file the activex is working well my only problem is to send the filename and not the file please help me Thank you in advanced Good Product Code:<%
'Option Explicit
Session.Timeout = 20 ' twenty minutes
'This variable specifies relative path to the folder, where the gallery with uploaded files is located.
'Do not forget about the slash in the end of the folder name.
Dim strGalleryPath
strGalleryPath = "Gallery/"
Sub ProcessUpload
'Create ABCUpload object for upload processing
Dim objUpload
Set objUpload = Server.CreateObject("ABCUpload4.XForm")
objUpload.MaxUploadSize = 60971520
objUpload.AbsolutePath = True
'First of all, clear files and data uploaded at previous time.
Dim objFolder, objFile
'Delete source files.
Set objFolder = objFileSystem.GetFolder(Server.MapPath(strGalleryPath))
Dim objDescriptions
'Set objDescriptions = Server.CreateObject("Msxml2.DOMDocument.4.0")
'objDescriptions.appendChild(objDescriptions.createElement("files"))
'Get total number of uploaded files (all files are uploaded in a single package).
Dim intFileCount, i
intFileCount = CInt(objUpload.Form("FileCount")(1))
'Iterate through uploaded data and save the original file, thumbnail, and description.
For i = 1 To intFileCount
'Get source file and save it to disk.
Dim objSourceFile
Set objSourceFile = objUpload.Files("SourceFile_" & i)
Dim strFileName
strFileName = GetSafeFileName(objSourceFile.SafeFileName)
objSourceFile.Save Server.MapPath(strGalleryPath & strFileName)
Dim objThumbnail1File
Set objThumbnail1File = objUpload.Files("Thumbnail1_" & i)
objThumbnail1File.Save Server.MapPath(strGalleryPath & "Thumbnails/" & strFileName & ".jpg")
'theConn = "Provider=SQLOLEDB;Server=localhost;UID=xx;PWD=xx;Database=xxxdb;"
'objRec.AddNew
'objRec("imgFile") = File.Binary
'objRec("imgType") = File.ImageType
'objRec("imgSize") = File.Size
'objRec("imgWidth") = File.ImageWidth
'objRec("imgHeight") = File.ImageHeight
'objRec("imgName") = File.FileName
'objRec.Update
'objRec.Close
'Set objRec = Nothing
'end if
Next
End Sub
'This method verifies whether file with such name already exists
'and if so, construct safe filename name (to avoid collision).
Function GetSafeFileName(strFileName)
Dim strNewFileName
strNewFileName = strFileName
Dim j
j = 1
While (objFileSystem.FileExists(Server.MapPath(strGalleryPath & strNewFileName)))
strNewFileName = j & "_" & strFileName
j = j + 1
Wend
GetSafeFileName = strNewFileName
End Function
Dim objFileSystem
Set objFileSystem = Server.CreateObject("Scripting.FileSystemObject")
ProcessUpload
%>
Edited by user Tuesday, February 19, 2008 1:09:00 PM(UTC)
| Reason: Not specified
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.