1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

fso.copyFile error

Discussion in 'C#' started by Lafaso870, Apr 30, 2011.

  1. #1
    Hi to all!

    I am a newbie in programming and in this forum. I hope somebody can help me to solve my problem. I am creating a web application(I used asp classic) that do the following:

    1. When the user upload a PDF file, the program will copy the PDF file into a specific folder in the server.
    2. If the file already exist, then it will replace the existing file.
    3. If not, then it will just copy it.

    what I did and problem:
    1. I put this one on the code to copy the file:
    fs.copyfile sam, "\\server1\web sites\ITWeb\docs", true
    Note: sam is the path of the PDF file soon to be copy.
    Problem: After running the code, the program tells me that it cannot found the path
    2. I tried to check if the source and destination folder exist in the sytem and I found out that the system cannot see the source folder, so I focus on the source folder.
    3. The source folder is just on my local computer: c:\my_workspace\documents\task.pdf, and i am sure with the path.
    4. When I try to do this:
    path=fs.GetAbsolutePathName("task.pdf")
    response.write(path)
    it gives me the pathname C:\WINDOWS\system32\inetsrv\task.pdf, so I tried to go the path but I cannot see anything.

    This scenario is really weird for me. Can anyone help me out of this???
    Any reply is highly appreciated.

    Thanks!!!
    SEMrush
     
    Lafaso870, Apr 30, 2011 IP
    SEMrush