Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: upload problems on server


Message #1 by "Tom Devins" <tdev01@y...> on Wed, 24 Apr 2002 21:30:54
Hi,

I've customized a "Simple Upload" script that works fine locally on my 
Windows 2K machine.

However, when I try to run my scripts on the server they don't work. I 
can't upload the file or write to the database. My "Sys Admin" has 
installed the Simple Upload program to C:ProgramFiles and I apparently 
have "everyone" write permissions to my uploads folder. Also, I currently 
have similar database write scripts working fine in other apps so I dont' 
think it's anything to do with this feature.

So ... what would be the problem between the two machines ... if the code 
works on my local 2K box I'm at a loss for why it won't work on the 
server ... only that I'm running my scripts locally in wwwroot and the 
server folder is a virtual folder on D: ... would this be enough to screw 
things up?

I've included my code below if anyone's interested. Thanks.


PS: the msado include file is on the server.
-----------------------------------------------

<% 
 Option Explicit 
  
 Dim upl, NewFileName, strPassedFilename, TitleName, strPassedTitle 
  
 Set upl = Server.CreateObject("ASPSimpleUpload.Upload") 
 
 If Len(upl.Form("File1")) > 0 Then 
    NewFileName = "/admin/users/uploads/" & upl.ExtractFileName(upl.Form
("File1")) 
	TitleName = upl.ExtractFileName(upl.Form("title"))
	strPassedTitle = TitleName
	strPassedFileName = NewFileName
    If upl.SaveToWeb("File1", NewFileName) Then 
         Response.Write("File successfully written to disk.")  
     Else 
         Response.Write("There was an error saving the file to disk.") 
     End If 
 End If 
 
%> 
 
 <!-- METADATA TYPE="typelib"
              FILE="C:\Program Files\Common Files\System\ado\msado15.dll" -
->
						
<%  'Following sets up database connection and adds newuser to members 
table
Dim objRS
  set objRS = Server.CreateObject("ADODB.Recordset")
   
 Dim strConn, strRecordName, Conn
   strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
   "Data Source=D:\ckfsite\admin\users\uploads.mdb;" & _
   "Persist Security Info=False"
  
  objRS.Open "upload_info", strConn, adOpenDynamic, adLockOptimistic, 
adCmdTable
  
	objRS.MoveLast
	objRS.AddNew   'adds the new record to database table
	objRS("title") = strPassedTitle
	objRS("filename") = strPassedFileName
	
    objRS("date_submitted") = Date
	
	objRS.Update
    objRS.Close
	
%>
   
<html><head><title>Thank You</title></head></title> 
 <body> 
Thank you for uploading your file.<br><br>
 </body> 
 </html> 

  Return to Index