ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 25th, 2008, 10:05 AM
dyouden dyouden is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2008
Posts: 2 dyouden User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 2 sec
Reputation Power: 0
"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.

Reply With Quote
  #2  
Old October 6th, 2008, 04:13 AM
MadCoder MadCoder is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2008
Posts: 9 MadCoder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 23 m 59 sec
Reputation Power: 0
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.

Reply With Quote
  #3  
Old October 23rd, 2008, 01:07 PM
dyouden dyouden is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2008
Posts: 2 dyouden User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 2 sec
Reputation Power: 0
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:
Originally Posted by MadCoder
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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > "path not found" error when using aspupload


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap