473,387 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Copying a file from another server

344 Expert 100+
Hi,
ASP is not my strongest subject. I am sure this must be easy-peasy to do but I can't get anywhere.

I have my own IIS server, running an ASP application.

I need to copy several files from somewhere on the web to my local server, where I can then process them. I know I am allowed to do this, as the web site concerened just says autocopy scripts must not be run more than once per hour.
This is one of the files I need to copy.

"http://en6.tribalwars.net/map/village.txt"

The best I could come up with was
Expand|Select|Wrap|Line Numbers
  1. <%option explicit
  2. dim fso
  3. Set fso = CreateObject("Scripting.FileSystemObject")
  4. 'rename live database
  5. fso.CopyFile "http://en6.tribalwars.net/map/village.txt","C:\t.txt"
  6. set fso=nothing
  7. %>
  8.  
But it dont want to know..

I can go to the site and download the files from there, but there are dozens of them, and I want to do this on a daily basis.

Any hints please.
Mar 10 '08 #1
3 1458
AricC
1,892 Expert 1GB
I don't know if you can pass copyfile a url try using a path

check this
http://www.w3schools.com/asp/met_copyfile.asp
Mar 11 '08 #2
Lysander
344 Expert 100+
I don't know if you can pass copyfile a url try using a path

check this
http://www.w3schools.com/asp/met_copyfile.asp
Nope, you can't. I get the error
'Bad file name or number'

There must be an easy way to do this, I mean, thats what every browser does when you type in a url
Mar 12 '08 #3
Lysander
344 Expert 100+
Found a solution on another site. This works. Now I just need to work out how to unzip it in code. (This is not the actual file I am after)

Expand|Select|Wrap|Line Numbers
  1. <%
  2.  
  3.   Response.Buffer = True
  4.   Dim objXMLHTTP, xml
  5.   Set xml = Server.CreateObject("Microsoft.XMLHTTP")
  6.  
  7.   xml.Open "GET", _
  8.       "http://www.4guysfromrolla.com/webtech/code/mitchell-pres.zip", _
  9.       False
  10.  
  11.   xml.Send
  12.  
  13. set oStream = createobject("Adodb.Stream")
  14. Const adTypeBinary = 1
  15. Const adSaveCreateOverWrite = 2
  16. Const adSaveCreateNotExist = 1 
  17. oStream.type = adTypeBinary
  18. oStream.open
  19. oStream.write xml.responseBody
  20. oStream.savetofile "C:\" & "Test.zip", adSaveCreateOverWrite
  21.  
  22. oStream.close
  23.  
  24. set oStream = nothing
  25.  
  26. Set xml = Nothing
  27.  
  28. %>
  29.  
Mar 17 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Robert Tarantino | last post by:
Hello, I am trying to find a way to create a scheduled task or service that will copy my local profile folders under "Documents and settings" to a network drive. This would allow me to restore...
5
by: Ian Davies | last post by:
Hello I am trying to use php to automate the copying of a file from my remotely hosted directory to my computer. I have put together the following but it will only do the copying from one...
2
by: Peter Sands | last post by:
Hi, I am testing out some restores to a stand-by server, by roll-forwading the logs. I have this setup. There is no user-exit, but logretain is on, for archive logging. I have 2 DB's on...
0
by: TB | last post by:
Hi All: This news group is proving to be great help on my path towards mastering ASP.NET thanks to all of you helpful souls out there. I am looking forward to the day when I can contribute with...
5
by: TB | last post by:
Hi All: This news group is proving to be great help on my path towards mastering ASP.NET thanks to all of you helpful souls out there. I am looking forward to the day when I can contribute...
4
by: zMisc | last post by:
Is it possible to copy a table from one schema to another schema by just copying the frm file to the directory for the new schema? What is the best way to create a new database with all the...
6
by: Jim Heavey | last post by:
I have written a little application which copies files from one location to another location. Before it copies the file, it ensure the directory for both the from and to locations is valid. It...
20
by: TC | last post by:
I need an automated procedure to copy data from an Access table to a SQL Server table. Speed is important. What is the recommended technique? I can export the data from Access, copy it via FTP,...
13
by: writeson | last post by:
Hi all, I'm writing some code that monitors a directory for the appearance of files from a workflow. When those files appear I write a command file to a device that tells the device how to...
2
by: chazzy69 | last post by:
This is a little hard to explain but i will try to make it as clear as possible. Firstly here's the setup, 2 databases on 2 different servers (databases are identical) now within the first...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.