473,804 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1604
Check http://www.aspfaq.com ;o)

--

Regards

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

Keeping it FREE!
"Darcy" <1D*********@1S 1i1t1e1w1a1r1e1 .1c1o1m1> wrote in message
news:Yy******** **********@news 04.bloor.is.net .cable.rogers.c om...
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.f tp

open 123.123.123.123
user REPLACETHISWITH YOURUSERNAME
REPLACETHISWITH YOURPASSWORD
lcd D:\LocalDirOnYo urServer
cd RemoteDirectory OnServer
type ascii
put asciifile.txt
type binary
put binaryfile.jpg
close
quit

Then execute this code:

Set oShell = CreateObject("W Script.Shell")
oShell.Run "%windir%\syste m32\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*********@1S 1i1t1e1w1a1r1e1 .1c1o1m1> wrote in message
news:Yy******** **********@news 04.bloor.is.net .cable.rogers.c om...
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_fil e]
ftp -s:ftpScript.ftp ftp.server.com
=============== ==
in the ftpScript.ftp file:(everythin g on new lines)
=============== ==
USERNAME
PASSWORD
cd REMOTEDIR
lcd PATH_TO_TEXTFIL E
PUT txtFile.txt
on error quit
quit
=============== ==

now on ur ASP page just:

set objShell = Server.CreateOb ject("WScript.S hell")
objShell.run PATH_TO_BAT_FIL E, 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*********@1S 1i1t1e1w1a1r1e1 .1c1o1m1> wrote in message
news:Yy******** **********@news 04.bloor.is.net .cable.rogers.c om...
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_fil e]
ftp -s:ftpScript.ftp ftp.server.com
=============== ==
in the ftpScript.ftp file:(everythin g on new lines)
=============== ==
USERNAME
PASSWORD
cd REMOTEDIR
lcd PATH_TO_TEXTFIL E
PUT txtFile.txt
on error quit
quit
=============== ==

now on ur ASP page just:

set objShell = Server.CreateOb ject("WScript.S hell")
objShell.run PATH_TO_BAT_FIL E, 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******** ******@tk2msftn gp13.phx.gbl...
Flakey componentless way:

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

open 123.123.123.123
user REPLACETHISWITH YOURUSERNAME
REPLACETHISWITH YOURPASSWORD
lcd D:\LocalDirOnYo urServer
cd RemoteDirectory OnServer
type ascii
put asciifile.txt
type binary
put binaryfile.jpg
close
quit

Then execute this code:

Set oShell = CreateObject("W Script.Shell")
oShell.Run "%windir%\syste m32\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*********@1S 1i1t1e1w1a1r1e1 .1c1o1m1> wrote in message
news:Yy******** **********@news 04.bloor.is.net .cable.rogers.c om...
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_fil e]
ftp -s:ftpScript.ftp ftp.server.com
=============== ==
in the ftpScript.ftp file:(everythin g on new lines)
=============== ==
USERNAME
PASSWORD
cd REMOTEDIR
lcd PATH_TO_TEXTFIL E
PUT txtFile.txt
on error quit
quit
=============== ==

now on ur ASP page just:

set objShell = Server.CreateOb ject("WScript.S hell")
objShell.run PATH_TO_BAT_FIL E, 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
9183
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 requiring a long, long formatted arglist via (%s,%s,%s,ad infinitum) if there is. So my question is: Is there a way to produce a very long multiline string of output with variables' values inserted without having to resort to this wacky """v...
4
1913
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 b, Column c) Table3 (Column a, Column b, Column c) Table1 contains a row of value (1, 2, 3)
1
2002
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. I've just added new prices to several drop-downs on our javascript-based ordering page. These new prices must have shipping costs added to them at the bottom of the ordering system in a text box called "Shipping", while the existing prices do not...
10
1655
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 static. Box 2 can expand, and should shrink boxes 3 and 4 accordingly. Box 5 can expand, and should shrink box 4 accordingly. I can use overflow: hidden, and JavaScript is OK. It only needs to work in Safari, so any cross-browser issues don't...
25
3414
by: PyPK | last post by:
What possible tricky areas/questions could be asked in Python based Technical Interviews?
0
1047
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. I need to make a comparison between 2 values
5
1637
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 this. assume I have it stored as such i have two dimensional array ball:
1
1395
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 10/01/2004 19:56 y708ga27 The Capital Group 10/01/2004 19:58 y708ga27 The Capital Group 10/01/2004 19:59 y708ga27 The Capital Group 10/01/2004 20:19 y708ga27 The Capital Group In a case like this - with consecutive logins for the same user, if
6
1272
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
1451
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 services from the first app. The thing is that when I create an instance of A in my win form app, I can't add bs to de arraylist. I can't even see the ArrayList. I also tryied with DataTables with no luck, should I try a DataSet. What am I...
0
9593
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10595
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10088
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9169
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7633
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5668
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4306
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.