Webboy2008
asked on
asp Dundas
Use Dundas with asp 3.0 for upload feature everything is working fine.
except I want to save the file name with "{" and "}"
now the dll automatically create string after upload process is completed
https://www.xxx.com/eServices/Secure/PDF//{FD4A73FF-1D79-413B-A56B-C C27BFBA724 C}_err.pdf
I just want the url with any { and }
any one know how to do it?
except I want to save the file name with "{" and "}"
now the dll automatically create string after upload process is completed
https://www.xxx.com/eServices/Secure/PDF//{FD4A73FF-1D79-413B-A56B-C
I just want the url with any { and }
any one know how to do it?
Function UploadProcessing_OpenBond(MaxUpload_Size,created_by,created_date)
'most control methods throw an exception if an error occurs so we will use an
' On Error Resume Next statement for error trapping purposes
On Error Resume Next
'create an instance of the Upload control
Set objUpload = Server.CreateObject ("Dundas.Upload.2")
objUpload.MaxUploadSize = MaxUpload_Size
objUpload.UseUniqueNames = True
objUpload.UseVirtualDir = False
if trim(Request.ServerVariables("server_name")) = "suretyappdev" then
objUpload.Save "E:\Websites\Dev\"
txtquoteid =trim(objUpload.form("txtquoteid"))
txtagencyid =trim(objUpload.form("txtagencyid"))
'document_description =trim(objUpload.form("txtdocumentdescription"))
if objUpload.Files.Count > 0 then
' retrieve original filename
origName = trim(objUpload.GetFileName(objUpload.Files(0).OriginalPath))
' retrieve filename as saved on the server
origNamewithserver = Replace(Replace(trim(objUpload.GetFileName(objUpload.Files(0).Path)),"{",""),"}","")
' retrieve file's extension, this will always be the same
sExt = trim(objUpload.GetFileExt(objUpload.Files(0).OriginalPath))
'size of the file
fileSize = trim(objUpload.Files(0).Size)
end if
'/////////////////////////////////////////////////////////
'check to see if method call was successful using VBScript's Err object, if
' an error occurred we will redirect user to a fictitious error page
'/////////////////////////////////////////////////////////
If Err.Number <> 0 Then
p=p & Err.Description
elseif fileSize > 2097152 then
p=p & "Your file is too big, we allows to upload up to 1 file to the server, with a maximum file size of one (2) MBytes per file only."
elseif sExt = "exe" or sExt = "EXE" then
p=p & "Executable file is not allowed to upload."
Else
'/////////////////////////////////////////////////////////
'use a For Each loop and check to see if the uploaded file is an
' executable (utilizing VBScript's InStr method), if it is delete it from disk.
'but first we will output the name of the file input box(es) responsible for uploads
'/////////////////////////////////////////////////////////
For Each objUploadedFile in objUpload.Files
'Response.Write "The "" & objUploadedFile.TagName & "" file input box was used to upload a file.<br>"
If InStr(1,objUploadedFile.ContentType,"octet-stream") Then
'/////////////////////////////////////////////////////////
'if the default web account does not have the right to delete files
' for the folder you save uploaded files to (in this case c:\temp) then you can either set
' the required rights manually or you could use the ImpersonateUser method
'/////////////////////////////////////////////////////////
objUploadedFile.Delete
End If
Next
webattachmentassignedIP="https://" & domainname & "/eServices/"
Attachment_url =webattachmentassignedIP & origNamewithserver
End If
'Release resources
Set objUpload = Nothing
UploadProcessing_OpenBond=Attachment_url
End Function
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.