Skip to main content
Participant
August 21, 2007
Question

Issue with ASP and quotes

  • August 21, 2007
  • 3 replies
  • 295 views
I am trying to copy an uploaded document from one directory to another. The uploaded file (attach1) will be dynamically named. The resulting file (LName) name is based on a last name field. I have the following code but I cannot figure out how to deal with the issue of quotation marks. Should I escape them or do I use another method?
This topic has been closed for replies.

3 replies

Inspiring
August 22, 2007
The code block would need to go after the recordset had been created which
will define the name of that variable.

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"ihsutd" <webforumsuser@macromedia.com> wrote in message
news:faheo8$tk$1@forums.macromedia.com...
> That seems like it will do the trick. When I try that code I get an error
>
> Variable is undefined: 'frmSend'
>
> Do I need to define that variable at some point? I assumed the frmSend
> being
> the form name would suffice.
>


ihsutdAuthor
Participant
August 22, 2007
That seems like it will do the trick. When I try that code I get an error

Variable is undefined: 'frmSend'

Do I need to define that variable at some point? I assumed the frmSend being the form name would suffice.
Inspiring
August 22, 2007
You should definitely change the code to something like this

dim fs, loadfile, movefile
loadfile = "E:\Inetpub\wwwroot\uploads\" &
frmSend.Fields.Item("attach1").Value & ".doc"
movefile = "E:\Inetpub\wwwroot\uploads\named\" &
frmSend.Fields.Item("LName").Value & ".doc"
set fs=Server.CreateObject("Scripting.FileSystemObject")
fs.MoveFile loadfile,movefile
set fs=nothing



--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"ihsutd" <webforumsuser@macromedia.com> wrote in message
news:faes3c$sca$1@forums.macromedia.com...
>I am trying to copy an uploaded document from one directory to another. The
> uploaded file (attach1) will be dynamically named. The resulting file
> (LName)
> name is based on a last name field. I have the following code but I cannot
> figure out how to deal with the issue of quotation marks. Should I escape
> them
> or do I use another method?
>
>
> dim fs
> set fs=Server.CreateObject("Scripting.FileSystemObject")
> fs.MoveFile
> "E:\Inetpub\wwwroot\uploads\<%=(frmSend.Fields.Item("attach1").Value)%>.doc","E:
> \Inetpub\wwwroot\uploads\named\<%=(frmSend.Fields.Item("LName").Value)%>.doc"
> set fs=nothing
>