|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
"path not found" error when using aspupload
I inherited a website written in asp with an access database. Apparently everything was working until my company changed webhosting companies. With the new hoster, we had to switch to DSN-less connections...I got the site to work for the most part, except for the code that allows an administrative user to upload pictures and text from a form, into the access database.
I get an error ... Microsoft VBScript runtime error '800a004c' "path not found" whenever I try to upload something. The lines that give the error are // IF FSO.FolderExists("\img\newimg\") THEN ELSE FSO.createfolder("\img\newimg") END IF ASPUpload.files.item(1).saveas "img\newimg\" & ASPUpload.files.item(1).filename // The folder that the code alludes to does indeed exist, and has permissions to allow webusers to write to the folder. I should mention that we also had to switch from MySmartUpload to ASPUpload...I don't know if I may have messed something up there. |
|
#2
|
|||
|
|||
|
Hello friend,
You need to use a complete physical path when saving the images... for example. E:\yourwebsite\images\ And btw .... Code:
IF FSO.FolderExists("\img\newimg\") THEN
ELSE
FSO.createfolder("\img\newimg")
END IF
This will error as your having noting happening after the THEN. Hope this helps. |
|
#3
|
|||
|
|||
|
more issues
I since found out that the hosting service does not allow this method of saving, so I had to file.SaveAsVirtual, and have tried to recode ...
this is the code so far. I am getting an error '800a01b6' Object doesn't support this property or method: 'file' Code:
<% OPTION EXPLICIT %>
<!--/////////////////////////////////////////////////////-->
<!-- #INCLUDE FILE ="connection.asp" -->
<!--/////////////////////////////////////////////////////-->
<%
' Variables
' *********
Dim FSO
Dim Conn
Dim Upload
Dim myPath
Dim strSQL
Dim rs
Dim ASPUpload
Dim file
Dim newId
Dim title
Dim dates
Dim times
Dim entry
Dim pAlt
Dim pHeight
Dim pWidth
Dim picture
Set Upload = Server.CreateObject("Persits.Upload")
Set FSO = CreateObject("Scripting.FileSystemObject")
' Connect to the DB
' *****************
Set Conn = Server.Createobject("ADODB.Connection")
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("database/artifact.mdb")
' Open a recordset
' ****************
strSQL = "SELECT * FROM tbl_new"
Set rs = Server.CreateObject ("ADODB.RecordSet")
Set rs.ActiveConnection = conn
rs.Source = strSQL
rs.LockType = 3
rs.Open
set title = (Upload.Form("title"))
set dates = (Upload.Form("dates"))
set times = (Upload.Form("times"))
set entry = (Upload.Form("entry"))
set pAlt = (Upload.Form("pAlt"))
set pHeight = (Upload.Form("pHeight"))
set pWidth = (Upload.Form("pWidth"))
set file = (Upload.File("picture"))
' Select each file and add the fields to a DB
' ****************
rs("dates") = dates
rs("times") = times
rs("title") = title
rs("entry") = entry
rs("picture") = picture
rs("pWidth") = pWidth
rs("pHeight") = pHeight
rs("pAlt") = pAlt
If not file.IsMissing Then
rs("picture") = file.FileName
myPath = Server.MapPath("images/")
file.SaveAsVirtual "images/" & file.FileName
End If
rs.Update
' Clean up
' ****************
Response.write("<b>"&"The discovery item has been modified"& "</b>")
Response.Write("<br>")
Response.Write("<br>")
Response.write("<b>"&"Title:" & "</b>" &" " & title)
Response.Write("<br>")
Response.write("<b>"&"Time:" & "</b>"&" " & times)
Response.Write("<br>")
Response.write("<b>"&"Date:" & "</b>"&" " & date)
Response.Write("<br>")
Response.write("<b>"&"Entry:"& "</b>" &" " & entry)
Response.Write("<br>")
Response.write("<b>"&"Picture file name:"& "</b>" &" " & picture)
Response.Write("<br>")
Response.write("<b>"&"Picture width in pixels:" & "</b>"&" " & pWidth)
Response.Write("<br>")
Response.write("<b>"&"Picture height in pixels:" & "</b>"&" " &pHeight)
Response.Write("<br>")
Response.write("<b>"&"Picture alt description:" & "</b>"&" " &pAlt)
Response.Write("<br>")
Response.Write("<br>")
Response.Write("<hr>")
Response.Write("Click <a href='admindiscovery.asp'>here</a> view administration module.</center>")
Response.Write("<br>")
Response.Write("Click <a href='addnewdiscovery.asp'>here</a> to add a new discovery.</center>")
rs.Close
Conn.Close
Set rs = nothing
Set Conn = nothing
%>
Quote:
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > "path not found" error when using aspupload |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|