Forum Moderators: open

Message Too Old, No Replies

Upload to remote server w/ dynamic path name

         

msmish

10:16 pm on Jan 23, 2004 (gmt 0)

10+ Year Member



I am attempting to upload files to a folder on a remote server. However the folder is different for each user based on login.
Is there anyway to do this using the code below. If not can someone tel me of a way to do it.

Dim DestinationPath
DestinationPath = Server.mapPath("UploadFolder")

what I'm doing is executing a query based on login for a varible called "uploadFolder", so I want my destination path to be something like
<% DestinationPath = Server.mapPath("rsRecord(uploadFolder)")%>

Of course my code doesn't work, so any ideas a greatly appreciated.

ziggystardust

9:11 pm on Jan 24, 2004 (gmt 0)

10+ Year Member



Hello,

you're doing:
Server.mapPath("rsRecord(uploadFolder)")

try:
Server.mapPath(rsRecord("uploadFolder"))

instead.

Good luck
//ZS

nileshkurhade

6:46 am on Jan 25, 2004 (gmt 0)

10+ Year Member



Yes nothing wrong after you remove those quotes as shown above.

msmish

9:25 pm on Jan 26, 2004 (gmt 0)

10+ Year Member



My problem here is not related to the syntax for the uploadFolder specifacally. It is related to the proper syntax when the uploadfolder is defined dynamically. I think
I've got that part solved with a
DestinationPath = (Server.MapPath(rsGetPath.Fields.Item("uploadPath").Value))

However now I get the following error message:
Request object, ASP 0206 (0x80004005)
Cannot call BinaryRead after using Request.Form collection.

Can some one tell me what my problem is here.

macrost

9:39 pm on Jan 26, 2004 (gmt 0)

10+ Year Member



Yeah, you have to use the name of what you are using for the upload class file.
Once you instantiate that class file, you can't use request.form, you have to use uploadclass.form to get info.

Mac

msmish

10:29 pm on Jan 26, 2004 (gmt 0)

10+ Year Member



Will changing the Destination Path to something like
DestinationPath = Server.MapPath(Form.UploadPath)do the trick.