i d/led an upload scritp and am modifing it for my site.
i get this error:
Microsoft VBScript runtime error '800a01a8'
Object required: '[string: "/020427_093132-14/"]'
/vids/test/utils.inc, line 20
with this code:
Function SaveUpload(Fields, DestinationFolder, LogFolder)
If DestinationFolder = "" Then DestinationFolder = Server.MapPath(".")
Dim OutFileName, FS, OutFolder, FolderName, Field
Dim LogLine, pLogLine, OutLine,Link
'Create unique upload folder
FolderName = UniqueFolderName
Set Link= "/" & FolderName & "/" & SaveFileName
Set FS = CreateObject("scripting.filesystemobject")
Set OutFolder = FS.CreateFolder(DestinationFolder + "\" + FolderName)
Dim SaveFileName, Name
'Save the uploaded fields and create a log line
For Each Field In Fields.Items
SaveFileName = Empty
If Field.FileName <> "" Then 'This field is uploaded file. Save the file to its own folder
SaveFileName = Field.FileName
FS.CreateFolder (OutFolder & "\" & Field.Name)
Else
If Field.Length > 0 Then SaveFileName = Field.Name
End If
If Not IsEmpty(SaveFileName) Then
Field.Value.SaveAs OutFolder & "\" & SaveFileName 'Write content of the field to the disk
else'!!!!!!!!!
End If
' response.write "<br>:" & SaveFileName & ":" & Field.Value.String'!!!!!!!!!
'Create log line with info about the field
LogLine = LogLine & """" & LogF(Field.Name) & LogSeparator & LogF(Field.Length) & LogSeparator & LogF(Field.ContentDisposition) & LogSeparator & LogF(Field.FileName) & LogSeparator & LogF(Field.ContentType) & """" & LogSeparator
Next
'Creates line with global request info
pLogLine = pLogLine & LogLine & Request.ServerVariables("REMOTE_ADDR") & LogSeparator & LogF(Request.ServerVariables("LOGON_USER")) & LogSeparator & Request.ServerVariables("HTTP_Content_Length") & LogSeparator & OutFolder & LogSeparator & LogF(Request.ServerVariables("ALL_RAW"))
'Create output line for the client
OutLine = OutLine & "Fields was saved to the <b>" & OutFolder & "</b> folder.<br>"
DoLog pLogLine, "UP"
'Save http header for debug purposes.
Dim TextStream
Set TextStream = FS.CreateTextFile(OutFolder & "\all_raw.txt")
TextStream.Write Request.ServerVariables("ALL_RAW")
TextStream.Close
OutFolder = Empty 'Clear variables.
SaveUpload = OutLine
End Function
what i am trying to do is make it so that the variable "Link" is the newfolder, and file name, and then have it add it to a db. the sql code is in another file if you need it.