elliottbenzle
asked on
trouble setting variable value
I should be able to do this by now, but I am having trouble setting the value of my variable to include the filename location. Right now it looks like this:
Dim myFile
myFile=File.Name
I want to add the text "uploads/" before the file name, becaue this is the location of the stored files. Below is what I tried but it didn't work. How do I do this?
myFile=("uploads/" & File.Name)
Dim myFile
myFile=File.Name
I want to add the text "uploads/" before the file name, becaue this is the location of the stored files. Below is what I tried but it didn't work. How do I do this?
myFile=("uploads/" & File.Name)
What happens if you manually assign the file name, like this:
Dim myFile, myDescription, myWidth, myHeight
myFile = "uploads/filename.jpg"
set comadddetail = Server.CreateObject("ADODB .Command")
comadddetail.ActiveConnect ion = MM_yotshop_STRING
comadddetail.CommandText = "INSERT INTO uploadedfiles ( filename, description, sWidth, sHeight) VALUES ( '" & myFile & "', '" & myDescription & "', " & myWidth & ", " & myHeight & " ) "
comadddetail.CommandType = 1
comadddetail.CommandTimeou t = 0
comadddetail.Prepared = true
comadddetail.Execute()
Dim myFile, myDescription, myWidth, myHeight
myFile = "uploads/filename.jpg"
set comadddetail = Server.CreateObject("ADODB
comadddetail.ActiveConnect
comadddetail.CommandText = "INSERT INTO uploadedfiles ( filename, description, sWidth, sHeight) VALUES ( '" & myFile & "', '" & myDescription & "', " & myWidth & ", " & myHeight & " ) "
comadddetail.CommandType = 1
comadddetail.CommandTimeou
comadddetail.Prepared = true
comadddetail.Execute()
Try:
myFile= "uploads/" & File.Name
myFile= "uploads/" & File.Name
ASKER
Rouchie that worked great. Would you mind explaining why, just so I don't make the same mistake again in the future?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Dim myFile, myDescription, myWidth, myHeight
myFile=("uploads/" & File.Name)
set comadddetail = Server.CreateObject("ADODB
comadddetail.ActiveConnect
comadddetail.CommandText = "INSERT INTO uploadedfiles ( filename, description, sWidth, sHeight) VALUES ( '" & myFile & "', '" & myDescription & "', " & myWidth & ", " & myHeight & " ) "
comadddetail.CommandType = 1
comadddetail.CommandTimeou
comadddetail.Prepared = true
comadddetail.Execute()