OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

fso.CopyFile - Copy File fromClient to Server

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP, PHP, and Database >> fso.CopyFile - Copy File fromClient to Server
Page: [1]
 
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 >


_____________________________


(in reply to aesquivel)
Spooky

 

Posts: 26681
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: fso.CopyFile - Copy File fromClient to Server - 11/18/2003 13:23:24   
I think you really want an upload component?
Either asp based or whatever your host provides.

http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=7361&lngWId=4

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to Long Island Lune)
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?

(in reply to Spooky)
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 15:19:26   
If your still interested in the code line, post what you tried to do (from my example above).

If your interested in Spooky's script instead - disregard this post. :)

< Message edited by Long Island Lune -- 11/18/2003 3:20:03 PM >


_____________________________


(in reply to aesquivel)
Spooky

 

Posts: 26681
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: fso.CopyFile - Copy File fromClient to Server - 11/18/2003 15:30:16   
Should be this link :

http://www.pscode.com/vb/scripts/ShowZip.asp?lngWId=4&lngCodeId=7361&strZipAccessCode=tp%2FU73611632

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to Long Island Lune)
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

(in reply to Long Island Lune)
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")


_____________________________


(in reply to aesquivel)
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?

_____________________________


(in reply to Long Island Lune)
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.

(in reply to Long Island Lune)
Page:   [1]

All Forums >> Web Development >> ASP, PHP, and Database >> fso.CopyFile - Copy File fromClient to Server
Page: [1]
Jump to: 1





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