asp Dundas

Posted on 2009-02-10
Last Modified: 2012-06-22
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{FD4A73FF-1D79-413B-A56B-CC27BFBA724C}_err.pdf
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."



	'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 &quot;" & objUploadedFile.TagName & "&quot; 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



		End If




	webattachmentassignedIP="https://" & domainname & "/eServices/"

    Attachment_url		   =webattachmentassignedIP & origNamewithserver

End If

'Release resources

Set objUpload = Nothing


End Function

Open in new window

Question by:Webboy2008
    1 Comment
    LVL 22

    Accepted Solution

    no experience with Dundas, but in general your code runs after the server has received and save the file, so if Dundas support does not answer, you have two approaches:
    1. remove {} and inside string.
    2. get filename from your form and pass it to replace generated name.
    but the best will be support answer

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    It’s quite interesting for me as I worked with Excel using for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    This video discusses moving either the default database or any database to a new volume.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now