---
title: "ASPUpload - fortfarande fel, trots sökfunktionen på webforum!"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/91488-aspupload-fortfarande-fel-trots-sökfunktionen-på-webforum"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "Wickmark"
published: "2003-11-28T13:58:11.000Z"
updated: "2003-11-28T14:58:26.000Z"
replies: 1
views: 213
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/91488-aspupload-fortfarande-fel-trots-sökfunktionen-på-webforum"
---

# ASPUpload - fortfarande fel, trots sökfunktionen på webforum!

## #1 — Wickmark, 2003-11-28T13:58Z

Hej,
Jag har hittat en hel del trådar om just detta jag kommer ta upp, men ingen av dem har fått mig att fatta, eftersom koden fortfarande crashar.

Felmeddelandet är:
Object required 
o klagar på rad 14

Koden är:

```
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include virtual="/LWSWE/adovbs.inc"-->
<%  if Session("type") = "admin" then
	dim strCAPTION, strTEXT, strPOSTER
	dim datDATE
	dim intFORUM, intTHREAD, intSMILIES, intPOSTER_ID, intSIGNATURE, intID
	dim uplFILE
	dim Upload, Conn, RecSet, File
	
 Set Upload = Server.CreateObject("Persits.Upload")

 Upload.Save ""&Server.MapPath("/LWSWE/3FactionAnphillia/upload")
     Set File = Upload.Files("file")
      strPath = File.Path [red][b]'<---Detta är rad 14[/b][/red]
	  if strPath <> "" then
        uplFILE = Right(strPath, Len(strPath) - InStrRev(strPath, "\", -1, 1))
	  else
	    uplFILE = ""
	  end if	
      
	  datDATE        = Now()
	  strCAPTION     = Upload.Form("CAPTION")
	  strTEXT        = Upload.Form("TEXT")
	  strPOSTER      = Upload.Form("POSTER")
	  intPOSTER_ID   = Upload.Form("POSTER_ID")
	  intFORUM 		 = Upload.Form("FORUM")  
	  intTHREAD      = Upload.Form("THREAD")
	  intSMILIES	 = Upload.Form("SMILIES")
	  intSIGNATURE	 = Upload.Form("SIGNATURE")
	  intID			 = Upload.Form("THREAD")

	  
  if Len(strCAPTION) => 1 and Len(strTEXT) => 1 and Len(strPOSTER) => 1 and Len(intPOSTER_ID) => 1 then
   
   if len(uplFILE) > 5 then 
     
   end if 
  
  	Set Conn = Server.CreateObject("ADODB.Connection")
	Set RecSet = Server.CreateObject("ADODB.RecordSet")	
		Conn.Open "PROVIDER=Microsoft.JET.OLEDB.4.0;Data Source="&Server.MapPath("/XXXXXX")
	  RecSet.Open "SELECT * FROM [F_ANSWERS]", Conn, adOpenStatic, adLockOptimistic, adcmdTableDirect
	  		RecSet.AddNew
			  RecSet("CAPTION")   = strCAPTION
			  RecSet("TEXT") 	  = strTEXT
			  RecSet("POSTER")    = strPOSTER
			  RecSet("POSTER_ID") = intPOSTER_ID
			  RecSet("SMILIES")   = intSMILIES
			  RecSet("SIGNATURE") = intSIGNATURE
			  RecSet("THREAD")    = intTHREAD
			  RecSet("DATE")      = datDATE
			  RecSet("FILE")      = uplFILE
			RecSet.Update
 		RecSet.Close : Set RecSet = Nothing
		Conn.Close : Set Conn = Nothing
 	      Response.Redirect("/LWSWE/3FactionAnphillia/start.asp?mItem=60&ID="&intID&"&f="&intFORUM&"")
	else
		  Response.Redirect("/LWSWE/3FactionAnphillia/start.asp?mItem=61&ID="&intID&"&f="&intFORUM&"&msg=INVALID_SUBMISSIONS")
	end if	

	else
	  Response.Redirect("/LWSWE/3FactionAnphillia/start.asp?mItem=9")
	end if  
%>
```

Vad är det som går galet?

Permalänk: https://www.webforum.nu/p/91488

## #2 — Wickmark, 2003-11-28T14:58Z

Fixat!!!
Trixade lite med koden, och nu funkar det perfekt!

```
      strPath = File.Path '<---Detta är rad 14
	  if strPath <> "" then
        uplFILE = Right(strPath, Len(strPath) - InStrRev(strPath, "\", -1, 1))
	  else
	    uplFILE = ""
	  end if
```

Skulle visst vara:
	

```
      if not file is nothing then
	  strPath = File.Path
	  if strPath <> "" then
        uplFILE = Right(strPath, Len(strPath) - InStrRev(strPath, "\", -1, 1))
	  else
	    uplFILE = ""
	  end if	
	  end if
```

Permalänk: https://www.webforum.nu/p/1215209

---

Tråden på webben: https://www.webforum.nu/amne/asp/91488-aspupload-fortfarande-fel-trots-sökfunktionen-på-webforum
