Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Upload Help
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

asp_storm
Average Member

USA
787 Posts

Posted - 27 April 2002 :  10:42:15  Show Profile  Visit asp_storm's Homepage  Send asp_storm an AOL message
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.



Nikkol
Forum Moderator

USA
6907 Posts

Posted - 27 April 2002 :  10:51:18  Show Profile
which line is line 20 exactly?

Nikkol
Go to Top of Page

asp_storm
Average Member

USA
787 Posts

Posted - 27 April 2002 :  10:52:19  Show Profile  Visit asp_storm's Homepage  Send asp_storm an AOL message
20:
  Set Link= "/" & FolderName & "/" & SaveFileName




Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 27 April 2002 :  10:55:56  Show Profile
try getting rid of Set on that line

Nikkol
Go to Top of Page

asp_storm
Average Member

USA
787 Posts

Posted - 27 April 2002 :  10:56:54  Show Profile  Visit asp_storm's Homepage  Send asp_storm an AOL message
nikkol..you have aim?



Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 27 April 2002 :  10:59:01  Show Profile
No, but I just sent you an email

Nikkol
Go to Top of Page

asp_storm
Average Member

USA
787 Posts

Posted - 27 April 2002 :  10:59:35  Show Profile  Visit asp_storm's Homepage  Send asp_storm an AOL message
the error is gone, but it make the value of url="" (empty)
everything else(the descriptions,etc) goes in fine



Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 27 April 2002 :  11:02:33  Show Profile
Where is the variable url in the code?

Nikkol
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.22 seconds. Powered By: Snitz Forums 2000 Version 3.4.07