For Programmers: Free Programming Magazines  


Home > Archive > ASP > February 2006 > Copying files from the server to the PC









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Copying files from the server to the PC
JimmySlam

2006-02-20, 6:55 pm

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


Paxton

2006-02-20, 6:55 pm


JimmySlam wrote:
> 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.

JimmySlam

2006-02-20, 6:55 pm


"Paxton" <paxtonend@hotmail.com> escribió en el mensaje
news:1140456469.885608.23300@o13g2000cwo.googlegroups.com...
>

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.




> JimmySlam wrote:
>
>
> 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.
>



Dave Anderson

2006-02-20, 6:55 pm

JimmySlam wrote:
> 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.


JimmySlam

2006-02-20, 6:55 pm

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.




"Dave Anderson" <GTSPXOESSGOQ@spammotel.com> escribió en el mensaje
news:OUgE7FlNGHA.1216@TK2MSFTNGP14.phx.gbl...
> JimmySlam wrote:
>
> 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.
>



Dave Anderson

2006-02-20, 6:55 pm

JimmySlam wrote:
> 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.


JimmySlam

2006-02-20, 6:55 pm

Sorry?

"Dave Anderson" <GTSPXOESSGOQ@spammotel.com> escribió en el mensaje
news:uroa3flNGHA.2696@TK2MSFTNGP14.phx.gbl...
> JimmySlam wrote:
>
> 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.
>



Paxton

2006-02-20, 6:55 pm

> JimmySlam wrote:

> "Dave Anderson" <GTSPXOESSGOQ@spammotel.com> escribi=F3 en el mensaje
> news:uroa3flNGHA.2696@TK2MSFTNGP14.phx.gbl...


[color=darkred]
> Sorry?



http://www.google.co.uk/search?hl=3...le+Search&meta=
=3D

/P.

JimmySlam

2006-02-20, 6:55 pm

Looks interesting, how do I use it?


"Paxton" <paxtonend@hotmail.com> escribió en el mensaje
news:1140474087.595893.155540@f14g2000cwb.googlegroups.com...
> JimmySlam wrote:


> "Dave Anderson" <GTSPXOESSGOQ@spammotel.com> escribió en el mensaje
> news:uroa3flNGHA.2696@TK2MSFTNGP14.phx.gbl...


[color=darkred]
> Sorry?



http://www.google.co.uk/search?hl=e...le+Search&meta=

/P.


Paxton

2006-02-20, 6:55 pm


JimmySlam wrote:

> "Paxton" <paxtonend@hotmail.com> escribi=F3 en el mensaje
> news:1140474087.595893.155540@f14g2000cwb.googlegroups.com...
>
>
>
>
>
>
> http://www.google.co.uk/search?hl=3...ogle+Search&me=

ta=3D
>
> /P.


> 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.

Dave Anderson

2006-02-22, 6:55 pm

top.
to
bottom
from
read
not
do
conversations
sentences,
Like
toppost.
not
do
Please

JimmySlam wrote:
> 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.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com