validating files in an upload function

Results 1 to 2 of 2

Thread: validating files in an upload function

  1. #1
    Join Date
    Dec 1969

    Default validating files in an upload function

    I am reposting this because it&#039;s so far down the list I don&#039;t think anyone will see it, and I&#039;m still lost. I have an upload page which saves a file into a folder named by the person uploading. I want to check the folder to see if the file is already present and write a message if it is. The thing is, that I need to use variables to describe the path and file name, and I don&#039;t know if this is possible.<BR>Here is what I&#039;m working with, though of course it doesnt work: <BR><BR>Dim objFSO <BR>Set objFSO = Server.CreateObject("Scripting.FileSystemObject") <BR>&#039;Create Folder <BR>If Not objFSO.FolderExists(Server.MapPath(Uploader.Form(" FULLNAME"))) then <BR>objFSO.CreateFolder(Server.MapPath(Uploader.Fo rm("FULLNAME"))) <BR>End If <BR>If objFSO.FileExists(Server.MapPath(Uploader.Form("FU LLNAME"))(Server.MapPath(Uploader.Form("FILE1")))) then <BR>Response.Write "This file already exists on the server. Please select another file to upload." <BR>End If <BR><BR>The Error is this: <BR>Server.MapPath() error &#039;ASP 0171 : 80004005&#039; <BR>Missing Path <BR>/Upload/uploadexmple.asp, line 48 <BR>The Path parameter must be specified for the MapPath method. <BR><BR>I checked the faq&#039;s but don&#039;t see how I can use the variables I&#039;m trying to use. Pipe dream? <BR>This is the last hurdle to getting this page to work great, so any hints would be greatly appreciated.

  2. #2
    Join Date
    Dec 1969

    Default RE: validating files in an upload function

    What is the output from:<BR>Response.Write Server.MapPath(Uploader.Form("FULLNAME"))<BR>and<B R>Response.Write Server.MapPath(Uploader.Form("FILE1"))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts