Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outfile to local machine

Status
Not open for further replies.

RayBec

Programmer
Dec 5, 2001
42
0
0
US
Thanks for the help. I've got a perl application with an Oracle backend. I'm able to output data to a file on the server, but can't get it to output on the local machine. I've tried the syntax... open (OUTFILE,"c:/cust.txt");
but the file is never created. The server is running Linux (redhat 7.0). Thanks!
 
The syntax you are using opens a file for reading only.

Try,

open(OUTFILE,"[red]>[/red]c:/cust.txt"); 'hope this helps

If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
 
Thanks for the input, but it still doesn't work. I've tried using A:/filename just to see if it accesses the a: drive and it doesn't. I don't know if I need an ip address of the machine that's accessing the web site. HELP!!!!
 
On which machine is the application running? The server or your local box?

'hope this helps

If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
 
The application resides on the Linux server. I've got folks from around the region accessing the server from the web on windows machines. The odd thing (at least for me)...is that I can upload files from a personal computer and it works fine.
 
For security reasons, a remote server will not be able to write to your local win box. That is, unless you've installed some networking hardware/software to allow the remote server to 'see' your hard drive as a network drive.
'hope this helps

If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
 
goboating...Thanks for the input. I've been on tek-tips for a while trying to figure this one out. I've seen lots of your work. Impressive. What advice would you give for getting the file out to the local machine? I've got lots of non-technical folks that will to pull these reports/files. Would you use ftp? I've seen a lot of references to FTP::Net. Thanks again.
 
Maybe you can write a shell script that runs the PERL script which creates the report and then emails the report to whoever and/or the report can be downloaded from a link on a certain Web page.
 
The sendmail idea sounds really good.
Thanks.
 
Net::FTP could work. In order to use an FTP based mechanism, your data (file) would have to be written to disk on the Linux machine where the Linux FTP server software could make it avilable. With the file written to disk on the Linux machine, you could use Net::FTP to retrieve the file. For more info on Net::FTP, do,
prompt> perldoc Net::FTP -enter-

However, if the data is already available via a web page, you could write a little perl on your local machine with the LWP module to retrieve the web page, pull out some pieces-parts and write them to local disk.

I'd lean toward the LWP approach.

Code:
#!/usr/local/bin/perl
use LWP::Simple;
$url = '[URL unfurl="true"]http://www.yahoo.com/';[/URL]

# this will retrieve the page
$content = get($url);
print "Got content\n\n$content\n";
'hope this helps

If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
 
This, given my expertise with web programming, is probably going to be wrong.

How about:

Create a file on the Linux machine, the web server, and when that's done - display a link on which the user can right-click and "Save Target As..." on his local machine.

I don't, surprise surprise, have the first clue how to do any of that except create the file on the server. :) Mike

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top