|
| |
|
|
aesquivel
Posts: 4 Joined: 11/18/2003 Status: offline
|
fso.CopyFile - Copy File fromClient to Server - 11/18/2003 12:57:43
ASP page...trying to use FSO.CopyFile to move a file from the client box to the server box. It is not allowing me to do this? Is this possible if so why is it not working for me? Or is there another way to move a file from a users client box to the server box? thanks My code: Dim fso Set fso = Server.CreateObject("Scripting.FileSystemObject") fso.CopyFile "c:\file.xxx","\\servername\shareddir\file.xxx"
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: fso.CopyFile - Copy File fromClient to Server - 11/18/2003 13:22:04
quote:
fso.CopyFile "c:\file.xxx","\\servername\shareddir\file.xxx" sourceFile = Server.Mappath ("C:\source location on your hard drive\your file") destFile = Server.Mappath ("/servername/shareddir") fso.CopyFile sourceFile, destFile, true Do not put the name of the file in destFile, just the path. Reverse the slashes in destFile too. You had them backwards. Check this out: http://www.sloppycode.net/fso/?m=52
< Message edited by Long Island Lune -- 11/18/2003 1:23:35 PM >
_____________________________
|
|
|
|
aesquivel
Posts: 4 Joined: 11/18/2003 Status: offline
|
RE: fso.CopyFile - Copy File fromClient to Server - 11/18/2003 15:11:02
I tired using the Long Islands code but that still didn't work for me...and I went to that site ...but I can't download the from the site...how do I download the zip from that site?
|
|
|
|
aesquivel
Posts: 4 Joined: 11/18/2003 Status: offline
|
RE: fso.CopyFile - Copy File fromClient to Server - 11/18/2003 15:36:33
Whatever works for me is fine...here is my code.....does there need to be any code in the <!-- #INCLUDE FILE="./include/clsUpload.asp"--> file? I'm doing this in a save function tha calls the function that runs the upload. Since I'm trying to Function SaveRec() ..... psV5 = "c:\temp\green.wav" 'this is my local box, retrieve the dest path from a input field box Call WaveFileUpload(psV5) --- this call is inside save function .... End Function Function WaveFileUpload(byRef sWaveFilePath) dim sourceFile dim destFile dim fso Set fso = Server.CreateObject("Scripting.FileSystemObject") sourceFile = server.MapPath (sWaveFilePath) destFile = server.MapPath("//docappa/Interfaces/VoicePortal/Inbox") 'this is a SHARED SERVER DIR DOES THAT MATTER? fso.CopyFile sourceFile, destFile, true Set fso = nothing End Function
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: fso.CopyFile - Copy File fromClient to Server - 11/18/2003 17:10:33
quote:
destFile = server.MapPath("//docappa/Interfaces/VoicePortal/Inbox") 'this is a SHARED SERVER DIR DOES THAT MATTER? No - it doesn't matter. What does mater is that you have write access (R/W/D) to that directory in your tree. Try either of these: ("/docappa/Interfaces/VoicePortal/Inbox") ("../docappa/Interfaces/VoicePortal/Inbox")
_____________________________
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: fso.CopyFile - Copy File fromClient to Server - 11/18/2003 17:11:58
quote:
sourceFile = server.MapPath (sWaveFilePath) One more thing.. What is sWaveFilePath? Is this a FULL path and file name to the file on your HD?
_____________________________
|
|
|
|
aesquivel
Posts: 4 Joined: 11/18/2003 Status: offline
|
RE: fso.CopyFile - Copy File fromClient to Server - 11/18/2003 17:21:42
YES, sWaveFilePath is the location & file name (c:\temp\green.wav)...where the file is coming from....so it would be the client box(user). So if the sWaveFilePath is the users box...then do I need to use "server.MapPath(sWaveFilePath)? I'll check on the write access..and try it again...thanks again for helping me out.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|