3 Replies Latest reply on Feb 15, 2007 7:34 AM by jlingwai


    jlingwai Level 1
      I'm tring to use the FileRefernce to upload a file. However, I can not use php or coldfusion since the iis im using does not support these scripts. I've attempted to send the variable to a javascript and from there I am populating a form that will use an asp script to upload the file. The probablem is I am unable to send the full file path. Does anyone know how to get the full file path?? or a better way to achieve this??

        • 1. Re: FileReference
          jlingwai Level 1
          Hey I solved this problem!!!!
          I used Javascript to call an asp upload class. If you want this code reply to this message and I'll post it.

          • 2. Re: FileReference
            How did you get the path?
            • 3. Re: FileReference
              jlingwai Level 1
              I used the uploadURL.method = URLRequestMethod.POST;
              From that the asp script can get the path the same way it gets the path with a form on a asp page. I also have to make a correction I used vbscript to call the upload class, but you can use javascript.

              here is the vb script that is called when the request is posted:

              Dim uploadsDirVar
              ' uploadsDirVar = server.mappath("upload")
              uploadsDirVar = "c:\uploaded\images"
              function SaveFiles
              Dim Upload, fileName, fileSize, ks, i, fileKey

              Set Upload = New FreeASPUpload

              ' If something fails inside the script, but the exception is handled
              If Err.Number<>0 then Exit function

              SaveFiles = ""
              ks = Upload.UploadedFiles.keys
              if (UBound(ks) <> -1) then
              SaveFiles = "<B>Files uploaded:</B> "
              for each fileKey in Upload.UploadedFiles.keys
              SaveFiles = SaveFiles & Upload.UploadedFiles(fileKey).FileName & " (" & Upload.UploadedFiles(fileKey).Length & "B) "
              SaveFiles = "The file name specified in the upload form does not correspond to a valid file in the system."
              end if
              end function