Copying files from the server to the PC

Discussion in 'ASP General' started by JimmySlam, Feb 20, 2006.

  1. JimmySlam

    JimmySlam Guest

    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
    JimmySlam, Feb 20, 2006
    #1
    1. Advertising

  2. JimmySlam

    Paxton Guest

    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.
    Paxton, Feb 20, 2006
    #2
    1. Advertising

  3. JimmySlam

    JimmySlam Guest

    "Paxton" <> escribió en el mensaje
    news:...
    >

    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:
    >> 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, Feb 20, 2006
    #3
  4. 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.
    Dave Anderson, Feb 20, 2006
    #4
  5. JimmySlam

    JimmySlam Guest

    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" <> escribió en el mensaje
    news:...
    > 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, Feb 20, 2006
    #5
  6. 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.
    Dave Anderson, Feb 20, 2006
    #6
  7. JimmySlam

    JimmySlam Guest

    Sorry?

    "Dave Anderson" <> escribió en el mensaje
    news:...
    > 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, Feb 20, 2006
    #7
  8. JimmySlam

    Paxton Guest

    > JimmySlam wrote:

    > "Dave Anderson" <> escribió en el mensaje
    > news:...
    > > 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.




    > Sorry?



    http://www.google.co.uk/search?hl=en&q=WebDAV&btnG=Google Search&meta=

    /P.
    Paxton, Feb 20, 2006
    #8
  9. JimmySlam

    JimmySlam Guest

    Looks interesting, how do I use it?


    "Paxton" <> escribió en el mensaje
    news:...
    > JimmySlam wrote:


    > "Dave Anderson" <> escribió en el mensaje
    > news:...
    > > 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.




    > Sorry?



    http://www.google.co.uk/search?hl=en&q=WebDAV&btnG=Google Search&meta=

    /P.
    JimmySlam, Feb 20, 2006
    #9
  10. JimmySlam

    Paxton Guest

    JimmySlam wrote:

    > "Paxton" <> escribió en el mensaje
    > news:...
    > > JimmySlam wrote:

    >
    > > "Dave Anderson" <> escribió en el mensaje
    > > news:...
    > > > 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.

    >
    >
    >
    > > Sorry?

    >
    >
    > http://www.google.co.uk/search?hl=en&q=WebDAV&btnG=Google Search&meta=
    >
    > /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.
    Paxton, Feb 20, 2006
    #10
  11. 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.
    Dave Anderson, Feb 22, 2006
    #11
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    480
  2. SagharAyyaz
    Replies:
    1
    Views:
    478
    Jonathan Mcdougall
    May 9, 2006
  3. Sarah

    Copying Files From Server to Server

    Sarah, Nov 13, 2004, in forum: ASP General
    Replies:
    1
    Views:
    97
    Ray Costanzo [MVP]
    Nov 15, 2004
  4. cocoin

    copying files from web to server

    cocoin, Feb 12, 2005, in forum: ASP General
    Replies:
    2
    Views:
    88
    Evertjan.
    Feb 12, 2005
  5. Shawn Mcclain
    Replies:
    0
    Views:
    177
    Shawn Mcclain
    Sep 28, 2007
Loading...

Share This Page