473,385 Members | 1,356 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,385 software developers and data experts.

Here's a tricky one! How to transfer a file from one Web server to another.

I would like for an ASP page to transfer a text file (from the same
directory the ASP file is in) to another Web server.

I don't mind if the code is in ASP or VB.

Any ideas?

I suspect that there is a way of having an ASP page conduct an FTP session
to transfer the file.

I would like to do this without a component as I'm looking for source code.

Thanks in advance....

Darcy
Jul 19 '05 #1
6 1590
Check http://www.aspfaq.com ;o)

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
"Darcy" <1D*********@1S1i1t1e1w1a1r1e1.1c1o1m1> wrote in message
news:Yy******************@news04.bloor.is.net.cabl e.rogers.com...
I would like for an ASP page to transfer a text file (from the same
directory the ASP file is in) to another Web server.

I don't mind if the code is in ASP or VB.

Any ideas?

I suspect that there is a way of having an ASP page conduct an FTP session
to transfer the file.

I would like to do this without a component as I'm looking for source code.
Thanks in advance....

Darcy

Jul 19 '05 #2
Flakey componentless way:

Create file on server with these contents and save it as something like
C:\ftpcommand.ftp

open 123.123.123.123
user REPLACETHISWITHYOURUSERNAME
REPLACETHISWITHYOURPASSWORD
lcd D:\LocalDirOnYourServer
cd RemoteDirectoryOnServer
type ascii
put asciifile.txt
type binary
put binaryfile.jpg
close
quit

Then execute this code:

Set oShell = CreateObject("WScript.Shell")
oShell.Run "%windir%\system32\ftp.exe -n -s:C:\ftpcommand.ftp", 0, False
Set oShell = Nothing

Ray at work

p.s. inetserver.asp.general is an active group. The other two that you
cross-posted to aren't.


"Darcy" <1D*********@1S1i1t1e1w1a1r1e1.1c1o1m1> wrote in message
news:Yy******************@news04.bloor.is.net.cabl e.rogers.com...
I would like for an ASP page to transfer a text file (from the same
directory the ASP file is in) to another Web server.

I don't mind if the code is in ASP or VB.

Any ideas?

I suspect that there is a way of having an ASP page conduct an FTP session
to transfer the file.

I would like to do this without a component as I'm looking for source code.
Thanks in advance....

Darcy

Jul 19 '05 #3
this way should work if ur working on ur own server instead of a sub-hosted
server.

Create:
Batch file to initiate ftp
ftpScript file with all ftp commands(login and put etc)
put them in the same directory

int the bat file:
=================
cd [path_to_bat_file]
ftp -s:ftpScript.ftp ftp.server.com
=================
in the ftpScript.ftp file:(everything on new lines)
=================
USERNAME
PASSWORD
cd REMOTEDIR
lcd PATH_TO_TEXTFILE
PUT txtFile.txt
on error quit
quit
=================

now on ur ASP page just:

set objShell = Server.CreateObject("WScript.Shell")
objShell.run PATH_TO_BAT_FILE, 0, True
set objShell = nothing

0 = don popup on console
True = wait till done

you can set this to false if you wanna

and ur done

lemme know if it works, sh!t i use it all the time to replicate files
between my servers overnite.
"Darcy" <1D*********@1S1i1t1e1w1a1r1e1.1c1o1m1> wrote in message
news:Yy******************@news04.bloor.is.net.cabl e.rogers.com...
I would like for an ASP page to transfer a text file (from the same
directory the ASP file is in) to another Web server.

I don't mind if the code is in ASP or VB.

Any ideas?

I suspect that there is a way of having an ASP page conduct an FTP session
to transfer the file.

I would like to do this without a component as I'm looking for source code.
Thanks in advance....

Darcy

Jul 19 '05 #4
this way should work if ur working on ur own server instead of a sub-hosted
server.

Create:
Batch file to initiate ftp
ftpScript file with all ftp commands(login and put etc)
put them in the same directory

int the bat file:
=================
cd [path_to_bat_file]
ftp -s:ftpScript.ftp ftp.server.com
=================
in the ftpScript.ftp file:(everything on new lines)
=================
USERNAME
PASSWORD
cd REMOTEDIR
lcd PATH_TO_TEXTFILE
PUT txtFile.txt
on error quit
quit
=================

now on ur ASP page just:

set objShell = Server.CreateObject("WScript.Shell")
objShell.run PATH_TO_BAT_FILE, 0, True
set objShell = nothing

0 = don popup on console
True = wait till done

you can set this to false if you wanna

and ur done

lemme know if it works, sh!t i use it all the time to replicate files
between my servers overnite.

Jul 19 '05 #5

Thank you that works!
"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:uT**************@tk2msftngp13.phx.gbl...
Flakey componentless way:

Create file on server with these contents and save it as something like
C:\ftpcommand.ftp

open 123.123.123.123
user REPLACETHISWITHYOURUSERNAME
REPLACETHISWITHYOURPASSWORD
lcd D:\LocalDirOnYourServer
cd RemoteDirectoryOnServer
type ascii
put asciifile.txt
type binary
put binaryfile.jpg
close
quit

Then execute this code:

Set oShell = CreateObject("WScript.Shell")
oShell.Run "%windir%\system32\ftp.exe -n -s:C:\ftpcommand.ftp", 0, False
Set oShell = Nothing

Ray at work

p.s. inetserver.asp.general is an active group. The other two that you
cross-posted to aren't.


"Darcy" <1D*********@1S1i1t1e1w1a1r1e1.1c1o1m1> wrote in message
news:Yy******************@news04.bloor.is.net.cabl e.rogers.com...
I would like for an ASP page to transfer a text file (from the same
directory the ASP file is in) to another Web server.

I don't mind if the code is in ASP or VB.

Any ideas?

I suspect that there is a way of having an ASP page conduct an FTP session to transfer the file.

I would like to do this without a component as I'm looking for source

code.

Thanks in advance....

Darcy


Jul 19 '05 #6
this way should work if ur working on ur own server instead of a sub-hosted
server.

Create:
Batch file to initiate ftp
ftpScript file with all ftp commands(login and put etc)
put them in the same directory

int the bat file:
=================
cd [path_to_bat_file]
ftp -s:ftpScript.ftp ftp.server.com
=================
in the ftpScript.ftp file:(everything on new lines)
=================
USERNAME
PASSWORD
cd REMOTEDIR
lcd PATH_TO_TEXTFILE
PUT txtFile.txt
on error quit
quit
=================

now on ur ASP page just:

set objShell = Server.CreateObject("WScript.Shell")
objShell.run PATH_TO_BAT_FILE, 0, True
set objShell = nothing

0 = don popup on console
True = wait till done

you can set this to false if you wanna

and ur done

lemme know if it works, sh!t i use it all the time to replicate files
between my servers overnite.

Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
by: Jim Hill | last post by:
I've done some Googling around on this and it seems like creating a here document is a bit tricky with Python. Trivial via triple-quoted strings if there's no need for variable interpolation but...
4
by: Bung | last post by:
Hi, I have a tricky sql statment I have to write (tricky for me) and I am stuck. I'm having trouble with the following problem. Table1 (Column a, Column b, Column c) Table2 (Column a, Column...
1
by: Tim | last post by:
Hello, I'm extremely puzzled; I cannot figure out what I'm doing wrong. Here's the situation. I would really appreciate any suggestions. I'm modifying a shopping cart in the following way....
10
by: Alan Little | last post by:
I have five boxes on a page. I need for the height to be no larger than one screen (it's for a kiosk). Here's the general layout: http://www.holotech.net/layout.gif The content of box 1 is...
25
by: PyPK | last post by:
What possible tricky areas/questions could be asked in Python based Technical Interviews?
0
by: Jon | last post by:
Hi all First of sorry that I'am posting in the wrong group But you guys and girls a very good with SQL statements Got a very tricky sql statement, and I've been pulling my hair to boldness....
5
by: Danny | last post by:
Hi there I need help with a tricky problem. I have a 2 dimensional array with qualities such as ball size, ball color, ball weight. Now I have to print out all the possible combinations of...
1
by: Pea | last post by:
I'm working with a system usage database. I want to filter out repetitive logins. The query I have retrieves data like this: USER_DATE USER_TIME1 USER_USERID USER_ACCOUNT...
6
by: pointBoarder | last post by:
Thanks in advance to all who read this. I've got 3 tables which were created from a txt file dumped from some old system. Header ID -- autonumber, primary OrderNum -- field I want Line
5
by: Sebastian | last post by:
Here's the thing I have a web aplication (1.1) and one of my classes has an array as a property (let's say Class A, has an ArrayList of Bs). On the other side I have a win form app which uses web...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.