Copying files from the server to the PC

J

JimmySlam

Hi how do i copy a file from the server to the PC?


Const ForWriting=2
strPath = Server.MapPath("datos.xml")
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set oFile = fso.GetFile(strPath)
Set tso = oFile.OpenAsTextStream(ForWriting)

sob=1
CopyFile "datos.xml", file://c:/datos.xml, sob
 
P

Paxton

JimmySlam said:
Hi how do i copy a file from the server to the PC?


Const ForWriting=2
strPath = Server.MapPath("datos.xml")
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set oFile = fso.GetFile(strPath)
Set tso = oFile.OpenAsTextStream(ForWriting)

sob=1
CopyFile "datos.xml", file://c:/datos.xml, sob


Basic file copy:

<%
dim fso
set fso=CreateObject("Scripting.FileSystemObject")
If fso.FileExists("c:\sourcefolder\anyfile.html") Then
fso.CopyFile "c:\sourcefolder\anyfile.html", "c:\destfolder\"
End If
%>

However, you need to say where the server is in relation to the PC you
want to write to. Are they on the same network? Or do you propose to
perform some action that will copy a file from a web server to a
visitors PC?

/P.
 
J

JimmySlam

yeah the problem is I am using a host on the internet. So I dont know the
path and i dont know how to call to the drive C on the local computer.
 
D

Dave Anderson

JimmySlam said:
yeah the problem is I am using a host on the internet.
So I dont know the path and i dont know how to call to
the drive C on the local computer.

http://aspfaq.com/show.asp?id=2161

Want to do it without user interaction? Tough. It's a security violation.



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
J

JimmySlam

yeah of course im not a hacker!!

I just have to upload pictures and then download them with one click to an
specific folder to the PC thats all. If i candownload a folder insted files
would be better.

Cheers.
 
D

Dave Anderson

JimmySlam said:
yeah of course im not a hacker!!

Right. But if you can do it, then so can a hacker.


I just have to upload pictures and then download them with
one click to an specific folder to the PC thats all. If i
candownload a folder insted files would be better.

Sounds like you need WebDAV.



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
J

JimmySlam

Sorry?

Dave Anderson said:
Right. But if you can do it, then so can a hacker.




Sounds like you need WebDAV.



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message.
Use of this email address implies consent to these terms. Please do not
contact me directly or ask me to contact you directly for assistance. If
your question is worth asking, it's worth posting.
 
P

Paxton

JimmySlam said:
Looks interesting, how do I use it?


I've got absolutely no idea, but if I wanted to use it or find out more
about it, I'd read some of the links and do a bit more searching.

Just a thought.....

/P.
 
D

Dave Anderson

top.
to
bottom
from
read
not
do
conversations
sentences,
Like
toppost.
not
do
Please
Looks interesting, how do I use it?

In the barest sense, you can use Internet Explorer and IIS. I'm not sure
about versions prior to 6, but in IIS 6, enable WebDAV in Web Service
Extensions. Then use the [Web Sharing] tab on the target folder's properties
to open a WebDAV share. In IE, go to

File : Open : [Type URL and check Open as Web Folder]



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top