Link to home
Start Free TrialLog in
Avatar of onL0oker
onL0oker

asked on

Questions about few problems with ASP script


I have created a script that uploads a file. When it is uploaded, the filename gets stored in the database. It all works locally. However, when I put the script and database on the remote server. It doesn't seem to upload. Moreover, my form validations says that the file doesn't exist. The path where the files get stored localed is stated with a path of "c:\file\upload." The same folders are set with on the server too. I have even given iuser permissions to read/write...  Any ideas why doesn't work. I'm thinking it's the path of the folder. Maybe, it can't find the folder.

Another question, the script can't seem to retrieve the information from the database. It retrieves the data from another database which isn't even pointing to it on the script. Does anyone know why this is happening? It works locally. But when I up the script and database to a remote server, this happens. It  can't seem to find the database where I set it.
Avatar of joeposter649
joeposter649

Are you using server.mappath to reference your upload and mdb files?
Avatar of onL0oker

ASKER


This is my script that uploads a file with conditions set. I'm not server mapping the path. Am I suppose to use server.map?

      <%
      Set Upload = Server.CreateObject("Persits.Upload.1")
      
      uploaddir = "c:\files\upload\"
      Upload.OverwriteFiles = False
      Upload.SaveToMemory

      Upload.Save(uploaddir)
      
      'checks for word document files, will reject if anything else
    For Each File in Upload.Files
      Filename = File.ExtractFilename
    Ext = UCase(Right(File.Path, 3))
      Size = File.Size

    If Not(Ext = "DOC") Then
            Response.write ("<script language=""javascript"">")                    'Better to user Javascript
            Response.write ("{alert(""Please submit Microsoft Word documents (*.doc) only!"")}")
            Response.write "javascript:history.back();"
            Response.write ("</script>")
      Else
            File.Copy("c:\files\upload\") & Filename ' & Session("directory") & "\"
            Session("wdstoryURL") = Filename
      End If
      
      Next
%>

The database is pretty much called through a include file which contains the dsn. I'm not server.mapping the mdb either. How do I map the mdb through the include file and also how do I server map the path for the upload script? How would I implement it base on what I have? Thanks.

Let me clear up the remote server. It is not exactly remote. It's pretty much a network. On my local machine, it works fine. Users could upload, and vew the retrieve information from the database perfectly.

But when I copy the files over the network to another computer. The database has also been setup for the script as well on that computer. It doesn't work. The script states the actual path of the directory where the upload files suppose to go. Do I really need to server map the path? Shouldn't it work because the script resides where the database and the actual path is at?
shouldn't this
File.Copy("c:\files\upload\") & Filename
be
File.Copy("c:\files\upload\" & Filename)
ASKER CERTIFIED SOLUTION
Avatar of TimRay15
TimRay15

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

I have already figured out the problem. Thanks.