couldn't solve in the other forum...

Results 1 to 4 of 4

Thread: couldn't solve in the other forum...

  1. #1
    Chris M Guest

    Default couldn't solve in the other forum...

    I tried to get an answer to this in the other forum, but no answer forthcoming. The following is code and an error message. I&#039;ve tried a number of things, including removing parentheses, removing quotations marks, using a variable instead of a string, using CopyFile of the FileSystemObject instead of Copy of the File object. Any other ideas?<BR><BR>&#060;%<BR>Dim strPathInfo, strPhysPath<BR><BR>strPathInfo = Request.ServerVariables("SCRIPT_NAME")<BR>strPhysP ath = Server.MapPath(strPathInfo)<BR><BR>Dim objFSO, objFolder, objFolderContents, objFileItem, objFile<BR>set objFSO = CreateObject("Scripting.FileSystemObject")<BR><BR> objFile = objFSO.GetFile(strPhysPath)<BR>objFile.Copy ("C:Inetpubwwwroot
    afi\",true)<BR><BR>Response.Write "<BR>It is done."<BR>%&#062;<BR><BR><BR><BR>Error Type:<BR>Microsoft VBScript compilation (0x800A0414)<BR>Cannot use parentheses when calling a Sub<BR>/tests/filemanip.asp, line 35, column 46<BR>objFile.Copy ("C:Inetpubwwwroot
    afi\",true)<BR>---------------------------------------------^<BR><BR><BR>Browser Type:<BR>Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) <BR><BR>Page:<BR>GET /tests/filemanip.asp <BR><BR>Time:<BR>Sunday, May 20, 2001, 5:00:41 PM

  2. #2
    Tony Guest

    Default RE: couldn't solve in the other forum...

    I don&#039;t know if you&#039;ve tried this or not, but if not, try replacing the line:<BR><BR>objFile.Copy ("C:Inetpubwwwroot
    afi\",true)<BR><BR>with either:<BR><BR>objFile.Copy "C:Inetpubwwwroot
    afi\", true<BR><BR>or:<BR><BR>call objFile.Copy("C:Inetpubwwwroot
    afi\",true)<BR><BR>I don&#039;t know if that helps or if you&#039;ve tried that already. Worth a shot though.<BR><BR>~~ Tony

  3. #3
    Chris M Guest

    Default Progress!! but...

    Great. I found the problem. It was that I was not "set"ting objFile to an object. However, now there&#039;s this problem...<BR><BR>I can use the Copy method, but not the Move method. When I try to use the move method, I get an error message that says "Permission denied." I think this is a problem with my IIS and not the ASP. Any ideas? Thanks.

  4. #4
    Join Date
    Dec 1969

    Default RE: Progress!! but...

    You need to make sure that you have the necessary privileges to the folder on the server you are trying to move from, as well as the folder you&#039;re trying to copy to.<BR>Since you say copy works fine, I&#039;d suspect you don&#039;t have delete permissions on the NT folder you&#039;re trying to move the file from.<BR><BR>To delete files you&#039;ll need to give the anonymous IIS server account full control. (or maybe modify is enough, not sure.)<BR><BR>Hope that helps.

Posting Permissions

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