Copying File from Web Server

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Dexter1
Pro Scripter
Posts: 64
Joined: Mon Jun 19, 2006 3:28 pm

Copying File from Web Server

Post by Dexter1 » Wed Jan 10, 2007 9:26 pm

I want to do a CopyFile command wich moves a text file from my web server to a standard network location. I tried:

CopyFile>//www.webserver.com/Folder/File.txt,\\Net ... n\File.txt

But to no avail. It seems like this shouldn't be so difficult and I really don't want to have to copy/paste or some other workaround if I don't have to.
Thanks,
Josh

Dexter1
Pro Scripter
Posts: 64
Joined: Mon Jun 19, 2006 3:28 pm

Post by Dexter1 » Wed Jan 10, 2007 9:28 pm

Woops, I had http at the beginning of my web address. This works like a champ now!

Sorry for the clutter.
Thanks,
Josh

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Fri Jan 12, 2007 12:00 am

Hi Dexter1,

I am trying to do almost exactly the same thing, use the CopyFile command to transfer a file from an internal company webserver to a user's hard drive but am not having any luck.

The following is the only way that works for me:
  • CopyFile>Y:\filename.txt,C:\filename.txt
However that's because I've mapped the Y: drive to the server on my PC.

What I'm after is syntax that will work on any user's PC and doesn't require a drive to be mapped. I've tried all the following ways and none of them work:
  • CopyFile>\\servername\filename.txt,C:\filename.txt
    CopyFile>\servername\filename.txt,C:\filename.txt
    CopyFile>//servername/filename.txt,C:\filename.txt
    CopyFile>/servername/filename.txt,C:\filename.txt
    CopyFile>servername/filename.txt,C:\filename.txt
    CopyFile>http://servername/filename.txt,C:\filename.txt
Dexter1, can you please post the line that worked for you so I can see the proper syntax? You can change the servername/filename if you need to.

Or Marcus, if you have this info, please post... thanks all.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Jan 12, 2007 2:09 am

I think you are missing a share name for the resource (folder) on the server

Change from:
CopyFile>\\servername\filename.txt,C:\filename.txt

Change To:
CopyFile>\\servername\C\filename.txt,C:\filename.txt for a file on the root or use
CopyFile>\\servername\C\foldername\filename.txt,C:\filename.txt for a file on a sub folder to the root.

Syntax = \\servername\server folder path\filename.txt
where server folder can be something like C or batch or Program Files or Data etc. If on the root of the server, then use the Drive Letter on the server system. Map a drive to the wanted resource and look in Explore to see the name of the resource used. You have mapped Y to the server, but look closely and you will see you mapped it to a drive and used a folder or the root of a drive.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Fri Jan 12, 2007 11:59 pm

Hi Bob,

You set me on the right path. The following syntax worked for me:
  • CopyFile>\\servername\sharename\filename.txt,C:\filename.txt
Once I had the proper servername and sharename, it worked fine.

Many Thanks :)
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts